English (United Kingdom)
Knowledge Base  >  Vik Restaurants  >  Hooks  >  Admin Menu  >  Define Menu Type

apply_filters( 'vikrestaurants_before_define_menu_type', string $menuType )

Fires while fetching the type of menu to use for the back-end of VikRestaurants.


Description

Plugins can use this filter to change the type of menu at runtime.

By default, VikRestaurants supports only 2 types of menu:

  • horizontal, placed above the plugin contents (default one);
  • leftboard, placed on the left side.

In case you wish to create your own layout, you can define all the required classes here:

/wp-content/plugins/vikrestaurants/site/helpers/library/menu/[MENU_TYPE]/

All the layouts should be placed here instead:

/wp-content/plugins/vikrestaurants/admin/layouts/menu/[MENU_TYPE]/

In case the specified layout doesn't exist, an exception will be thrown.


Parameters

$menuType

(string)  The type of the menu to use.


Example

The example below explains how to use the leftboard layout in place of the default one.

/**
 * Trigger filter to allow the plugins to choose a specific type to
 * use for the layout of the back-end menu.
 *
 * @param  string  $menuType  The menu type to use.
 */
add_filter('vikrestaurants_before_define_menu_type', function($menuType)
{
    return 'leftboard';
});

Changelog

Version Description
1.0 Introduced.
Last Update: 2021-01-24
Helpful?
See Also:

This website uses cookies

This website uses cookies and similar technologies. Some of these technologies are necessary for the proper functioning of the website (Essential). Other technologies are used to evaluate user behavior (Analysis), to integrate external media or for advertising purposes. If you agree, these technologies are activated. For details, please refer to the privacy policy. From this same page you can also update/revoke your consent. If you do not give your consent, only cookies with essential functions will be activated.

We use technologies from the USA on our website. If you give your consent, you therefore consent at the same time to your data being transferred to the USA. We would like to point out that the USA does not have a level of data protection comparable to that of the EU and that any US company can be obliged by state authorities to hand over your data without you having any effective legal protection against this.