Make WordPress Core


Ignore:
Timestamp:
12/11/2015 10:11:03 PM (8 years ago)
Author:
swissspidy
Message:

Admin Menu: Deprecate add_object_page() and add_utility_page().

These functions are not used in core and are just wrappers for add_menu_page().

Fixes #23108.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r35731 r35874  
    10811081
    10821082/**
    1083  * Add a top-level menu page in the 'objects' section.
    1084  *
    1085  * This function takes a capability which will be used to determine whether
    1086  * or not a page is included in the menu.
    1087  *
    1088  * The function which is hooked in to handle the output of the page must check
    1089  * that the user has the required capability as well.
    1090  *
    1091  * @global int $_wp_last_object_menu
    1092  *
    1093  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1094  * @param string   $menu_title The text to be used for the menu.
    1095  * @param string   $capability The capability required for this menu to be displayed to the user.
    1096  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1097  * @param callable $function   The function to be called to output the content for this page.
    1098  * @param string   $icon_url   The url to the icon to be used for this menu.
    1099  * @return string The resulting page's hook_suffix.
    1100  */
    1101 function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
    1102     global $_wp_last_object_menu;
    1103 
    1104     $_wp_last_object_menu++;
    1105 
    1106     return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_object_menu);
    1107 }
    1108 
    1109 /**
    1110  * Add a top-level menu page in the 'utility' section.
    1111  *
    1112  * This function takes a capability which will be used to determine whether
    1113  * or not a page is included in the menu.
    1114  *
    1115  * The function which is hooked in to handle the output of the page must check
    1116  * that the user has the required capability as well.
    1117  *
    1118  * @global int $_wp_last_utility_menu
    1119  *
    1120  * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
    1121  * @param string   $menu_title The text to be used for the menu.
    1122  * @param string   $capability The capability required for this menu to be displayed to the user.
    1123  * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
    1124  * @param callable $function   The function to be called to output the content for this page.
    1125  * @param string   $icon_url   The url to the icon to be used for this menu.
    1126  * @return string The resulting page's hook_suffix.
    1127  */
    1128 function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
    1129     global $_wp_last_utility_menu;
    1130 
    1131     $_wp_last_utility_menu++;
    1132 
    1133     return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_utility_menu);
    1134 }
    1135 
    1136 /**
    11371083 * Add a submenu page.
    11381084 *
Note: See TracChangeset for help on using the changeset viewer.