add_plugins_page

函式
add_plugins_page ( $page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = null )
引數
  • (string) $page_title The text to be displayed in the title tags of the page when the menu is selected.
    Required:
  • (string) $menu_title The text to be used for the menu.
    Required:
  • (string) $capability The capability required for this menu to be displayed to the user.
    Required:
  • (string) $menu_slug The slug name to refer to this menu by (should be unique for this menu).
    Required:
  • (callable) $callback Optional. The function to be called to output the content for this page.
    Required:
    Default: (empty)
  • (int) $position Optional. The position in the menu order this item should appear.
    Required:
    Default: null
返回值
  • (string|false) The resulting page's hook_suffix, or false if the user does not have the capability required.
定義位置
相關方法
add_links_pageadd_options_pageadd_pages_pageis_plugin_pageadd_posts_page
引入
3.0.0
棄用
-

add_plugins_page。一個函式,在WordPress管理面板的外掛選單中新增一個新的子選單頁面。它允許開發者在WordPress管理面板中新增自己的外掛設定或頁面。

在外掛主選單中新增一個子選單頁面。

這個函式接受一個許可權,這個許可權將被用來決定一個頁面是否被包含在選單中。

鉤住處理頁面輸出的函式必須檢查使用者是否具有所需的許可權。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = null ) {
return add_submenu_page( 'plugins.php', $page_title, $menu_title, $capability, $menu_slug, $callback, $position );
}
function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = null ) { return add_submenu_page( 'plugins.php', $page_title, $menu_title, $capability, $menu_slug, $callback, $position ); }
function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = null ) {
	return add_submenu_page( 'plugins.php', $page_title, $menu_title, $capability, $menu_slug, $callback, $position );
}

常見問題

FAQs
檢視更多 >