Model for a sub menu
WPDK Sample
- Author
- =undo= info@.nosp@m.wpxt.nosp@m.re.me
- Copyright
- Copyright (C) 2012-2013 wpXtreme Inc. All Rights Reserved.
- Date
- 2013-02-26
- Version
- 1.0.1
Definition at line 521 of file wpdk-menu.php.
__construct |
( |
|
$parent, |
|
|
|
$id, |
|
|
|
$menu_title, |
|
|
|
$view_controller = '' , |
|
|
|
$capability = self::DEFAULT_CAPABILITY |
|
) |
| |
Construct.
Create an instance of WPDKSubMenu class
- Parameters
-
string | object | $parent | Any WPDKMenu object or string id of parent |
string | $id | Submenu unique string id |
string | $menu_title | The submenu title |
string | $view_controller | Optional. Name of view controller or a callback function. |
string | $capability | Optional. Minum capabilties to show thhi item. Default WPDKSubMenu::DEFAULT_CAPABILITY |
- Returns
- WPDKSubMenu
Definition at line 562 of file wpdk-menu.php.
Render.
Register this sub menu tree to WordPress menu
Definition at line 653 of file wpdk-menu.php.
static renderByArray |
( |
|
$sub_menus | ) |
|
|
static |
Render by array.
Return an array of sub menu tems. Render a list of sub menu from any top level menu. Useful to add sub menus to Custom Post Type top level menu or to any WordPress top level menu
Example
$sub_menus = array(
'edit.php?post_type=' . WPXMailManagerCustomPostType::ID => array(
WPDKSubMenuDivider::DIVIDER,
array(
'menuTitle' => __( 'Settings', WPXMAILMANAGER_TEXTDOMAIN ),
'capability' => self::MENU_CAPABILITY,
'viewController' => 'WPXMailManagerConfigurationViewController'
),
WPDKSubMenuDivider::DIVIDER,
array(
'menuTitle' => __( 'About', WPXMAILMANAGER_TEXTDOMAIN ),
'capability' => self::MENU_CAPABILITY,
'viewController' => 'WPXMailManagerConfigurationViewController'
),
)
);
WPDKSubMenu::renderByArray( $sub_menus );
- Parameters
-
array | $sub_menus | A key value pairs list of sub menus |
- Returns
- array
Definition at line 611 of file wpdk-menu.php.
$capability = self::DEFAULT_CAPABILITY |
array $query_args = array() |
Query args.
Query args to add to url page
- Since
- 1.3.1
Definition at line 546 of file wpdk-menu.php.
const DEFAULT_CAPABILITY = 'read' |
The documentation for this class was generated from the following file: