• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress core a2z

WordPress core a2z

WordPress core only

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / add_theme_page() – Add submenu page to the Appearance main menu.

You appear to be a bot. Output may be restricted

Description

Add submenu page to the Appearance main menu.

This function takes a capability which will be used to determine whether or not a page is included in the menu. The function which is hooked in to handle the output of the page must check that the user has the required capability as well.

Usage

$string|false = add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $function, $position );

Parameters

$page_title
( string ) required – The text to be displayed in the title tags of the page when the menu is selected.
$menu_title
( string ) required – The text to be used for the menu.
$capability
( string ) required – The capability required for this menu to be displayed to the user.
$menu_slug
( string ) required – The slug name to refer to this menu by (should be unique for this menu).
$function
( callable ) optional – The function to be called to output the content for this page.
$position
( int ) optional – The position in the menu order this item should appear.

Returns

string|false The resulting page's hook_suffix, or false if the user does not have the capability required.

Source

File name: wordpress/wp-admin/includes/plugin.php
Lines:

1 to 3 of 3
function add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $position = null ) {
  return add_submenu_page( 'themes.php', $page_title, $menu_title, $capability, $menu_slug, $function, $position );
}
 

 View on GitHub View on Trac

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: add_theme_page
Plugin ref: WordPress
Version: 5.6
Sourcefile: wp-admin/includes/plugin.php
File ref: wp-admin/includes/plugin.php
Deprecated?: No
API Letters: A,P,T

Footer

WP-a2z
WordPress core a2z
WordPress core only
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  core.wp-a2z.org
© Copyright WP-a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites