WordPress函数文档add_management_page()

在后台管理界面的“工具”菜单下增加二级菜单 描述 Add sub menu page to the tools…

在后台管理界面的“工具”菜单下增加二级菜单

描述

Add sub menu page to the tools main menu.

NOTE: If you’re running into the »You do not have sufficient permissions to access this page.« message in a wp_die() screen, then you’ve hooked too early. The hook you should use is admin_menu.

用法

 <?php
add_management_page
$page_title$menu_title$capability$menu_slug$function );
?> 

参数

$page_title

(string) (必填) The text to be displayed in the title tags of the page when the menu is selected.

默认值: None

$menu_title

(string) (必填) The text to be used for the menu

默认值: None

$capability

(string) (必填) The capability required for this menu to be displayed to the user. User levels are deprecated and should not be used here!

默认值: None

$menu_slug

(string) (必填) The slug name to refer to this menu by (should be unique for this menu).

默认值: None

$function

(callback) (可选) The function to be called to output the content for this page.

默认值: Empty string

返回值

(string|bool) 

The resulting page’s hook_suffix, or false if the user does not have the $capability required.

示例

注意

  • 使用到: add_submenu_page() Used to add the page to the Tools menu.

相关

Administration Menus:
add_menu_page(),
remove_menu_page(),
add_submenu_page(),
remove_submenu_page(),
add_dashboard_page(),
add_posts_page(),
add_media_page(),
add_links_page(),
add_pages_page(),
add_comments_page(),
add_theme_page(),
add_plugins_page(),
add_users_page(),
add_management_page(),
add_options_page()

  • 原文:http://codex.wordpress.org/Function_Reference/add_management_page
类别:WordPress函数文档

本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论 (0)COMMENT