add plugins page

描述

为插件添加菜单的子菜单页面

使用

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

参数

$page_title
( string) ( required) The text to be displayed in the title tags of the page when the menu is selected
Default:  None
$menu_title
( string) ( required) The text to be used for the menu
Default:  None
$capability
( string) ( required) The  capability required for this menu to be displayed to the user.
Default:  None
$menu_slug
( string) ( required) The slug name to refer to this menu by (should be unique for this menu).
Default:  None
$function
( callback) ( optional) The function to be called to output the content for this page.
Default: ' '

Return Values

string 
The resulting page's hook_suffix ( What add_submenu_page() returns)

Notes

  • This function is a simple wrapper for a call to add_submenu_page(), passing the received arguments and specifying 'plugins.php' as the $parent_slug argument. This means the new page will be added as a sub menu to the Plugins menu.
  • The $capability parameter is used to determine whether or not the page is included in the menu based on the Roles and Capabilities) of the current user.
  • The function handling the output of the options page should also verify the user's capabilities.

笔记

这是一个简单的包装函数调用添加子菜单是_ _页(),通过指定的接收参数和plugins.php美元”的“母_塞的问题。该算法将由新的网页插件菜单的子菜单。
该功能参数是用美元来确定是否该网页是包含在基于角色的菜单功能)和当前的用户。

输出处理功能的选项页面也应该验证的用户的能力。

示例

Typical usage occurs in a function registered with the 'admin_menu' hook (see Adding Administration Menus):


add_action('admin_menu', 'my_plugin_menu');

function my_plugin_menu() {
	add_plugins_page('My Plugin Page', 'My Plugin', 'read', 'my-unique-identifier', 'my_plugin_function');
}

Source File

add_plugins_page() is located in wp-admin/includes/plugin.php.

Related

Administration Menusadd_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()


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值