\MainWP\DashboardMainWP_Menu

Class MainWP_Menu

Summary

Methods
Properties
Constants
get_class_name()
__construct()
init_mainwp_menus()
init_mainwp_menu_items()
init_sub_pages()
set_menu_active_slugs()
init_subpages_left_menu()
is_disable_menu_item()
add_left_menu()
render_left_menu()
render_mobile_menu()
render_sub_item()
is_level2_menu_item_active()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

get_class_name()

get_class_name() : object

Method get_class_name()

Get Class Name.

Returns

object

__construct()

__construct() 

MainWP_Menu constructor.

Run each time the class is called. Define MainWP Main Menu Items.

init_mainwp_menu_items()

init_mainwp_menu_items(array  $menus_items, string  $part) 

Method init_mainwp_menu_items()

Init MainWP menus.

Parameters

array $menus_items

menus items.

string $part

menus part.

set_menu_active_slugs()

set_menu_active_slugs(string  $item, string  $active) 

Method set_menu_active_slugs

Parameters

string $item

Menu item.

string $active

Menu active slug.

init_subpages_left_menu()

init_subpages_left_menu(array  $subPages, array  $initSubpage, string  $parentKey, mixed  $slug) 

Method init_subpages_left_menu

Build left menu subpages array.

Parameters

array $subPages

Array of SubPages.

array $initSubpage

Initial SubPage Array.

string $parentKey

Parent Menu Slug.

mixed $slug

SubPage Slug.

is_disable_menu_item()

is_disable_menu_item(string  $level, array  $item) : boolean

Method is_disable_menu_item

Check if $_mainwp_disable_menus_items contains any menu items to hide.

Parameters

string $level

The level the menu item is on.

array $item

The menu items meta data.

Returns

boolean —

True|False, default is False.

add_left_menu()

add_left_menu(array  $params = array(), integer  $level = 1) : array

Method add_left_menu

Build Top Level Menu

Parameters

array $params

Menu Item parameters.

integer $level

Menu Item Level 1 or 2.

Returns

array —

$mainwp_leftmenu[] | $mainwp_sub_leftmenu[].

render_left_menu()

render_left_menu() 

Method render_left_menu

Build Top Level Main Menu HTML & Render.

render_mobile_menu()

render_mobile_menu() 

Method render_mobile_menu

Renders the mobile menu.

render_sub_item()

render_sub_item(mixed  $parent_key) 

Method render_sub_item

Grabs all submenu items and attatches to Main Menu.

Parameters

mixed $parent_key

The parent key.

is_level2_menu_item_active()

is_level2_menu_item_active(mixed  $href) 

Method is_level2_menu_item_active().

Check if menu item level 2 is active.

Parameters

mixed $href

The href value.