<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[35731] trunk/src/wp-admin/includes/plugin.php: Docs: Improve DocBlock formatting for `add_menu_page()` and `add_submenu_page()` wrappers.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/35731">35731</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/35731","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-11-23 17:55:24 +0000 (Mon, 23 Nov 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Docs: Improve DocBlock formatting for `add_menu_page()` and `add_submenu_page()` wrappers.
See <a href="https://core.trac.wordpress.org/ticket/34360">#34360</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludespluginphp">trunk/src/wp-admin/includes/plugin.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludespluginphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/plugin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/plugin.php 2015-11-23 17:14:39 UTC (rev 35730)
+++ trunk/src/wp-admin/includes/plugin.php 2015-11-23 17:55:24 UTC (rev 35731)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1013,7 +1013,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> //
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add a top level menu page
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add a top-level menu page.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1026,19 +1026,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @global array $_registered_pages
</span><span class="cx" style="display: block; padding: 0 10px"> * @global array $_parent_pages
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- * @param string $icon_url The url to the icon to be used for this menu.
- * * Pass a base64-encoded SVG using a data URI, which will be colored to match the color scheme.
- * This should begin with 'data:image/svg+xml;base64,'.
- * * Pass the name of a Dashicons helper class to use a font icon, e.g. 'dashicons-chart-pie'.
- * * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS.
- * @param int $position The position in the menu order this one should appear
- *
- * @return string The resulting page's hook_suffix
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @param string $icon_url The URL to the icon to be used for this menu.
+ * * Pass a base64-encoded SVG using a data URI, which will be colored to match
+ * the color scheme. This should begin with 'data:image/svg+xml;base64,'.
+ * * Pass the name of a Dashicons helper class to use a font icon,
+ * e.g. 'dashicons-chart-pie'.
+ * * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS.
+ * @param int $position The position in the menu order this one should appear.
+ * @return string The resulting page's hook_suffix.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '', $position = null ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $menu, $admin_page_hooks, $_registered_pages, $_parent_pages;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1080,7 +1080,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add a top level menu page in the 'objects' section
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add a top-level menu page in the 'objects' section.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1090,14 +1090,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global int $_wp_last_object_menu
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- * @param string $icon_url The url to the icon to be used for this menu
- *
- * @return string The resulting page's hook_suffix
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @param string $icon_url The url to the icon to be used for this menu.
+ * @return string The resulting page's hook_suffix.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
</span><span class="cx" style="display: block; padding: 0 10px"> global $_wp_last_object_menu;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1108,7 +1107,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add a top level menu page in the 'utility' section
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add a top-level menu page in the 'utility' section.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1118,14 +1117,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global int $_wp_last_utility_menu
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- * @param string $icon_url The url to the icon to be used for this menu
- *
- * @return string The resulting page's hook_suffix
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @param string $icon_url The url to the icon to be used for this menu.
+ * @return string The resulting page's hook_suffix.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
</span><span class="cx" style="display: block; padding: 0 10px"> global $_wp_last_utility_menu;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1136,7 +1134,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add a sub menu page
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add a submenu page.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1147,17 +1145,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @global array $submenu
</span><span class="cx" style="display: block; padding: 0 10px"> * @global array $menu
</span><span class="cx" style="display: block; padding: 0 10px"> * @global array $_wp_real_parent_file
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @global bool $_wp_submenu_nopriv
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global bool $_wp_submenu_nopriv
</ins><span class="cx" style="display: block; padding: 0 10px"> * @global array $_registered_pages
</span><span class="cx" style="display: block; padding: 0 10px"> * @global array $_parent_pages
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $parent_slug The slug name for the parent menu (or the file name of a standard WordPress admin page)
- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $parent_slug The slug name for the parent menu (or the file name of a standard WordPress admin page).
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1210,7 +1207,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add sub menu page to the Tools main menu.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add submenu page to the Tools main menu.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1218,12 +1215,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The function which is hooked in to handle the output of the page must check
</span><span class="cx" style="display: block; padding: 0 10px"> * that the user has the required capability as well.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_management_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1231,7 +1227,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add sub menu page to the Settings main menu.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add submenu page to the Settings main menu.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1239,12 +1235,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The function which is hooked in to handle the output of the page must check
</span><span class="cx" style="display: block; padding: 0 10px"> * that the user has the required capability as well.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_options_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1252,7 +1247,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add sub menu page to the Appearance main menu.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add submenu page to the Appearance main menu.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1260,12 +1255,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The function which is hooked in to handle the output of the page must check
</span><span class="cx" style="display: block; padding: 0 10px"> * that the user has the required capability as well.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1273,7 +1267,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add sub menu page to the Plugins main menu.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add submenu page to the Plugins main menu.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1281,12 +1275,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The function which is hooked in to handle the output of the page must check
</span><span class="cx" style="display: block; padding: 0 10px"> * that the user has the required capability as well.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1294,7 +1287,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add sub menu page to the Users/Profile main menu.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add submenu page to the Users/Profile main menu.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1302,12 +1295,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The function which is hooked in to handle the output of the page must check
</span><span class="cx" style="display: block; padding: 0 10px"> * that the user has the required capability as well.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_users_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1318,7 +1310,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return add_submenu_page( $parent, $page_title, $menu_title, $capability, $menu_slug, $function );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add sub menu page to the Dashboard main menu.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add submenu page to the Dashboard main menu.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1326,12 +1318,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The function which is hooked in to handle the output of the page must check
</span><span class="cx" style="display: block; padding: 0 10px"> * that the user has the required capability as well.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_dashboard_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1339,7 +1330,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add sub menu page to the Posts main menu.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add submenu page to the Posts main menu.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1347,12 +1338,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The function which is hooked in to handle the output of the page must check
</span><span class="cx" style="display: block; padding: 0 10px"> * that the user has the required capability as well.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1360,7 +1350,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add sub menu page to the Media main menu.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add submenu page to the Media main menu.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1368,12 +1358,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The function which is hooked in to handle the output of the page must check
</span><span class="cx" style="display: block; padding: 0 10px"> * that the user has the required capability as well.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_media_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1381,7 +1370,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add sub menu page to the Links main menu.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add submenu page to the Links main menu.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1389,12 +1378,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The function which is hooked in to handle the output of the page must check
</span><span class="cx" style="display: block; padding: 0 10px"> * that the user has the required capability as well.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_links_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1402,7 +1390,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add sub menu page to the Pages main menu.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add submenu page to the Pages main menu.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1410,12 +1398,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The function which is hooked in to handle the output of the page must check
</span><span class="cx" style="display: block; padding: 0 10px"> * that the user has the required capability as well.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_pages_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1423,7 +1410,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add sub menu page to the Comments main menu.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Add submenu page to the Comments main menu.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function takes a capability which will be used to determine whether
</span><span class="cx" style="display: block; padding: 0 10px"> * or not a page is included in the menu.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1431,12 +1418,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The function which is hooked in to handle the output of the page must check
</span><span class="cx" style="display: block; padding: 0 10px"> * that the user has the required capability as well.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
- * @param string $menu_title The text to be used for the menu
- * @param string $capability The capability required for this menu to be displayed to the user.
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
- * @param callable $function The function to be called to output the content for this page.
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_comments_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1444,14 +1430,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Remove a top level admin menu
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Remove a top-level admin menu.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global array $menu
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $menu_slug The slug of the menu
- * @return array|bool The removed menu on success, False if not found
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $menu_slug The slug of the menu.
+ * @return array|bool The removed menu on success, false if not found.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function remove_menu_page( $menu_slug ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $menu;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1467,15 +1453,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Remove an admin submenu
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Remove an admin submenu.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global array $submenu
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $menu_slug The slug for the parent menu
- * @param string $submenu_slug The slug of the submenu
- * @return array|bool The removed submenu on success, False if not found
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $menu_slug The slug for the parent menu.
+ * @param string $submenu_slug The slug of the submenu.
+ * @return array|bool The removed submenu on success, false if not found.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function remove_submenu_page( $menu_slug, $submenu_slug ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $submenu;
</span></span></pre>
</div>
</div>
</body>
</html>