프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$capability | string | Minumun capabilty require to display this menu | |
$hookName | string | WorkPress hook name - returned from add_menu_page() | |
$icon | string | The url to the icon to be used for this menu. | |
$id | string | Unique menu ID | |
$menuTitle | string | The top level menu title | |
$position | integer | The position in the menu order this one should appear | |
$subMenus | array | An array with the sub menus list |
메소드 | 설명 | |
---|---|---|
__construct ( string $id, string $menu_title, string $capability = self::DEFAULT_CAPABILITY, string $icon = '', integer $position = null ) : WPDKMenu | Create an instance of WPDKMenu class | |
addDivider ( string $title = '' ) : WPDKSubMenu | Add a special submenu as separator | |
addSubMenu ( string $menu_title, string $view_controller, string $capability = WPDKMenu::DEFAULT_CAPABILITY ) : WPDKSubMenu | Return an instance of WPDKSubMenu after add a sub menu to this main menu | |
addSubMenuAt ( array &$menus, array $menu_item, integer $index ) : array | Add a submenu item at index position into the $menus array, | |
addSubMenusAt ( array &$menus, array $submenus, integer $index ) : mixed | Recursive version of self::addSubMenuAt() | |
hook ( string $view_controller ) : string | Return the hook id for a view controller | |
isPageWithMenu ( string $id ) : boolean | Return TRUE if the displayed page is the view controller | |
menu ( string | array $view_controller ) : array | Return the WPDK menu info by name of view controller of submenu item | |
page ( string $view_controller ) : string | Return the page id for a view controller | |
render ( ) | Register this menu tree to WordPress menu | |
renderByArray ( array $menus ) : array | Return an array with WPDKMenu instance as render a menu from an array | |
sanitizeViewController ( string | array $view_controller ) : string | Return a sanitize view controller for a callable | |
url ( string $view_controller ) : string | Return the compute URL of menu item from view controller name |
public __construct ( string $id, string $menu_title, string $capability = self::DEFAULT_CAPABILITY, string $icon = '', integer $position = null ) : WPDKMenu | ||
$id | string | menu unique string id |
$menu_title | string | The menu title |
$capability | string | Optional. Minimun capabilties to show this item. Default WPDKMenu::DEFAULT_CAPABILITY |
$icon | string | Optional. The url to the icon to be used for this menu. Using 'none' would leave div.wp-menu-image empty so an icon can be added as background with CSS. |
$position | integer | Optional. The position in the menu order this one should appear |
리턴 | WPDKMenu |
public addDivider ( string $title = '' ) : WPDKSubMenu | ||
$title | string | |
리턴 | WPDKSubMenu |
public addSubMenu ( string $menu_title, string $view_controller, string $capability = WPDKMenu::DEFAULT_CAPABILITY ) : WPDKSubMenu | ||
$menu_title | string | Menu title |
$view_controller | string | Name of view controller |
$capability | string | Optional. Minimun capabilties to show this item. Default WPDKMenu::DEFAULT_CAPABILITY |
리턴 | WPDKSubMenu |
public static isPageWithMenu ( string $id ) : boolean | ||
$id | string | The menu id |
리턴 | boolean |
public static renderByArray ( array $menus ) : array | ||
$menus | array | A key value pairs array with the list of menu |
리턴 | array |
public string $capability | ||
리턴 | string |
public string $hookName | ||
리턴 | string |
public int $position | ||
리턴 | integer |