From 9835b5ff2506d73bd0068ff8eef3cfa9df29dd20 Mon Sep 17 00:00:00 2001 From: scribu Date: Thu, 9 Dec 2010 06:54:48 +0000 Subject: [PATCH] Add @return to add_*menu_page() docs. Fixes #15747 git-svn-id: https://develop.svn.wordpress.org/trunk@16831 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/plugin.php | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index 5310558744..69856d991a 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -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,7 +1220,9 @@ 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,7 +1241,9 @@ 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 ); }