English (United Kingdom)
Knowledge Base  >  Vik Appointments  >  Hooks  >  Employee  >  Private Area  >  Menu  >  Setup Sidebar Menu

apply_filters_ref_array( 'vikappointments_setup_employees_area_sidebar_menu', bool $status, array &$menu )

Fires before displaying the sidebar menu in the Employees Area.


Description

Trigger hook to allow the plugins to alter the items of the sidebar menu displayed within the Employees Area.

Here it is possible to attach new items or detach/edit existing ones.

The items of the menu are associative arrays, which should specify the following attributes:

Name Type Description
separator boolean Whether to add a separator after this menu item.
title string The title to display within the button.
icon string The icon to display before the button title.
query array An array of query attributes to be added within the URL.

 The new items to push within the array must be registered with a unique key.


Parameters

$status

(bool)  True on success, false otherwise.

&$menu

(array)  The sidebar menu array.


Example

The example below detaches the "Coupons" item from the sidebar menu.

/**
 * Trigger hook to allow the plugins to alter the items of the sidebar menu
 * displayed within the Employees Area.
 *
 * @param  boolean  $status  True on success, false otherwise.
 * @param  array    &$menu   The sidebar menu.
 */
add_filter('vikappointments_setup_employees_area_sidebar_menu', function($status, &$menu)
{
    unset($menu['coupons']);

    return $status;
}, 10, 2);

Changelog

Version Description
1.2 Introduced.
Last Update: 2021-10-04
Helpful?