Add @return to add_*menu_page() docs. Fixes #15747

git-svn-id: http://svn.automattic.com/wordpress/trunk@16831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-12-09 06:54:48 +00:00
parent 474c3f0672
commit 1474c1a64a
1 changed files with 32 additions and 2 deletions

View File

@ -862,6 +862,8 @@ function uninstall_plugin($plugin) {
* @param callback $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
* @param int $position The position in the menu order this one should appear
*
* @return string The resulting page's hook_suffix
*/
function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '', $position = NULL ) {
global $menu, $admin_page_hooks, $_registered_pages, $_parent_pages;
@ -910,6 +912,8 @@ function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $func
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $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
*/
function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
global $_wp_last_object_menu;
@ -934,6 +938,8 @@ function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $fu
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $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
*/
function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
global $_wp_last_utility_menu;
@ -958,6 +964,8 @@ function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $f
* @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 callback $function The function to be called to output the content for this page.
*
* @return string The resulting page's hook_suffix
*/
function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
global $submenu;
@ -1020,6 +1028,8 @@ function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability,
* @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 callback $function The function to be called to output the content for this page.
*
* @return string The resulting page's hook_suffix
*/
function add_management_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'tools.php', $page_title, $menu_title, $capability, $menu_slug, $function );
@ -1039,6 +1049,8 @@ function add_management_page( $page_title, $menu_title, $capability, $menu_slug,
* @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 callback $function The function to be called to output the content for this page.
*
* @return string The resulting page's hook_suffix
*/
function add_options_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'options-general.php', $page_title, $menu_title, $capability, $menu_slug, $function );
@ -1058,6 +1070,8 @@ function add_options_page( $page_title, $menu_title, $capability, $menu_slug, $f
* @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 callback $function The function to be called to output the content for this page.
*
* @return string The resulting page's hook_suffix
*/
function add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'themes.php', $page_title, $menu_title, $capability, $menu_slug, $function );
@ -1077,6 +1091,8 @@ function add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $fun
* @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 callback $function The function to be called to output the content for this page.
*
* @return string The resulting page's hook_suffix
*/
function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'plugins.php', $page_title, $menu_title, $capability, $menu_slug, $function );
@ -1096,6 +1112,8 @@ function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $f
* @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 callback $function The function to be called to output the content for this page.
*
* @return string The resulting page's hook_suffix
*/
function add_users_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
if ( current_user_can('edit_users') )
@ -1118,6 +1136,8 @@ function add_users_page( $page_title, $menu_title, $capability, $menu_slug, $fun
* @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 callback $function The function to be called to output the content for this page.
*
* @return string The resulting page's hook_suffix
*/
function add_dashboard_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'index.php', $page_title, $menu_title, $capability, $menu_slug, $function );
@ -1137,6 +1157,8 @@ function add_dashboard_page( $page_title, $menu_title, $capability, $menu_slug,
* @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 callback $function The function to be called to output the content for this page.
*
* @return string The resulting page's hook_suffix
*/
function add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'edit.php', $page_title, $menu_title, $capability, $menu_slug, $function );
@ -1156,6 +1178,8 @@ function add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $fun
* @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 callback $function The function to be called to output the content for this page.
*
* @return string The resulting page's hook_suffix
*/
function add_media_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'upload.php', $page_title, $menu_title, $capability, $menu_slug, $function );
@ -1175,6 +1199,8 @@ function add_media_page( $page_title, $menu_title, $capability, $menu_slug, $fun
* @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 callback $function The function to be called to output the content for this page.
*
* @return string The resulting page's hook_suffix
*/
function add_links_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'link-manager.php', $page_title, $menu_title, $capability, $menu_slug, $function );
@ -1194,6 +1220,8 @@ function add_links_page( $page_title, $menu_title, $capability, $menu_slug, $fun
* @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 callback $function The function to be called to output the content for this page.
*
* @return string The resulting page's hook_suffix
*/
function add_pages_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'edit.php?post_type=page', $page_title, $menu_title, $capability, $menu_slug, $function );
@ -1213,6 +1241,8 @@ function add_pages_page( $page_title, $menu_title, $capability, $menu_slug, $fun
* @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 callback $function The function to be called to output the content for this page.
*
* @return string The resulting page's hook_suffix
*/
function add_comments_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'edit-comments.php', $page_title, $menu_title, $capability, $menu_slug, $function );