add_links_page

函式
add_links_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_plugins_pageadd_options_pagelink_pageswp_link_pages_wp_link_page
引入
2.7.0
棄用
-

add_links_page: 這個函式在”連結”主選單下新增一個新的子選單頁: 該函式接受三個引數:頁面標題、選單標題和訪問該頁面所需的許可權。

在連結主選單中新增一個子選單頁面。

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

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

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

常見問題

FAQs
檢視更多 >