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

apply_filters( 'vikappointments_before_define_menu_type', string $menuType )

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


Description

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

By default, VikAppointments 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/vikappointments/site/helpers/libraries/menu/[MENU_TYPE]/

All the layouts should be placed here instead:

/wp-content/plugins/vikappointments/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('vikappointments_before_define_menu_type', function($menuType)
{
    return 'leftboard';
});

Changelog

Version Description
1.0 Introduced.
Last Update: 2021-07-28
Helpful?
See Also: