The params of add options page -- explain in detail

add_options_page( string $page_title,  string $menu_title,  string $capabilitystring $menu_slug,  callable $function = '' )

Parameters Parameters

$page_title
(string) (Required) The text to be displayed in the title tags of the page when the menu is selected. It will be displayed in the position 1.

$menu_title
(string) (Required) The text to be used for the menu.  It will be displayed in the position 2.
$capability
(string) (Required) The capability required for this menu to be displayed to the user.
This confused me because I don't know what capabilities I can choose until I found this page: List of possible capabilities are here
$menu_slug
(string) (Required) The slug name to refer to this menu by (should be unique for this menu). This will be used in the url. For example: http://127.0.0.1/html2/wp-admin/options-general.php?page=baidu-translator. 'baidu-translator' is a menu_slug.
$function
(callable) (Optional) The function to be called to output the content for this page.
Default value: ''.

评论

此博客中的热门博文

Openwrt路由器上配置shadowsocks透明代理+gfwlist(PAC)

Configure shadowsocks transparent proxy + gfwlist(PAC) on OpenWRT Router

Using Haproxy + shadowsocks (ha + ss) to setup multi ss backend and load balance