Class AdminPageFramework_Controller_Menu
Provides methods to manipulate menu items.
Package: AdminPageFramework\Factory\AdminPage
Since: 2.0.0
Since: 3.3.1 Changed the name from
AdminPageFramework_Menu
.Since: 3.6.3 Changed the name from
AdminPageFramework_Menu_Controller
.Extends: AdminPageFramework_View_Menu
Located at factory/admin_page/AdminPageFramework_Controller_Menu.php
Methods summary
public
|
#
setRootMenuPage( string $sRootMenuLabel, string $sIcon16x16 = null, string $iMenuPosition = null )
Sets to which top level page is going to be adding sub-pages. Example$this->setRootMenuPage( 'Settings' ); $this->setRootMenuPage( 'APF Form', plugins_url( 'image/screen_icon32x32.jpg', __FILE__ ) ); Parameters
Since
2.0.0
2.1.6 The $sIcon16x16 parameter accepts a file path. 3.0.0 The scope was changed to public from protected. Remark
Only one root page can be set per one class instance.
|
public
|
#
setRootMenuPageBySlug( string $sRootMenuSlug )
Sets the top level menu page by page slug. The page should be already created or scheduled to be created separately. Example$this->setRootMenuPageBySlug( 'edit.php?post_type=apf_posts' ); Parameters
Since
2.0.0
3.0.0 The scope was changed to public from protected. |
public
|
#
addSubMenuItems( )
Adds sub-menu items on the left sidebar menu of the administration panel. It supports pages and links. Each of them has the specific array structure. Example$this->addSubMenuItems( array( 'title' => 'Various Form Fields', 'page_slug' => 'first_page', 'screen_icon' => 'options-general', ), array( 'title' => 'Manage Options', 'page_slug' => 'second_page', 'screen_icon' => 'link-manager', ), array( 'title' => 'Google', 'href' => 'http://www.google.com', 'show_page_heading_tab' => false, // this removes the title from the page heading tabs. ) ); Since
2.0.0
3.0.0 Changed the scope to public. Remark
The sub menu page slug should be unique because add_submenu_page() can add one
callback per page slug.
Accepts variadic parameters; the number of accepted parameters are not limited to three. |
public
|
#
addSubMenuItem( array $aSubMenuItem )
Adds the given sub-menu item on the left sidebar menu of the administration panel. It supports pages and links. Each of them has the specific array structure. Example$this->addSubMenuItem( array( 'title' => 'Read Me', 'menu_title' => 'About' 'page_slug' => 'my_plugin_readme', ) ); Parameters
Since
2.0.0
3.0.0 Changed the scope to public. Remark
The sub menu page slug should be unique because add_submenu_page() can add one
callback per page slug.
|
Magic methods summary
Properties summary
Related
Indirect known subclasses
AdminPageFramework
,
AdminPageFramework_Controller
,
AdminPageFramework_NetworkAdmin
,
AdminPageFramework_View