Make WordPress Core

Ticket #23108: 23108.3.patch

File 23108.3.patch, 6.1 KB (added by swissspidy, 9 years ago)
  • src/wp-admin/includes/deprecated.php

    diff --git src/wp-admin/includes/deprecated.php src/wp-admin/includes/deprecated.php
    index b984d6d..81398cc 100644
    function wp_dashboard_secondary_control() {} 
    13051305function _relocate_children( $old_ID, $new_ID ) {
    13061306        _deprecated_function( __FUNCTION__, '3.9' );
    13071307}
     1308
     1309/**
     1310 * Add a top-level menu page in the 'objects' section.
     1311 *
     1312 * This function takes a capability which will be used to determine whether
     1313 * or not a page is included in the menu.
     1314 *
     1315 * The function which is hooked in to handle the output of the page must check
     1316 * that the user has the required capability as well.
     1317 *
     1318 * @since 2.7.0
     1319 *
     1320 * @deprecated 4.5.0 Use add_menu_page()
     1321 * @see add_menu_page()
     1322 * @global int $_wp_last_object_menu
     1323 *
     1324 * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1325 * @param string   $menu_title The text to be used for the menu.
     1326 * @param string   $capability The capability required for this menu to be displayed to the user.
     1327 * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1328 * @param callable $function   The function to be called to output the content for this page.
     1329 * @param string   $icon_url   The url to the icon to be used for this menu.
     1330 * @return string The resulting page's hook_suffix.
     1331 */
     1332function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
     1333        _deprecated_function( __FUNCTION__, '4.5', 'add_menu_page()' );
     1334
     1335        global $_wp_last_object_menu;
     1336
     1337        $_wp_last_object_menu++;
     1338
     1339        return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_object_menu);
     1340}
     1341
     1342/**
     1343 * Add a top-level menu page in the 'utility' section.
     1344 *
     1345 * This function takes a capability which will be used to determine whether
     1346 * or not a page is included in the menu.
     1347 *
     1348 * The function which is hooked in to handle the output of the page must check
     1349 * that the user has the required capability as well.
     1350 *
     1351 * @since 2.7.0
     1352 *
     1353 * @deprecated 4.5.0 Use add_menu_page()
     1354 * @see add_menu_page()
     1355 * @global int $_wp_last_utility_menu
     1356 *
     1357 * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
     1358 * @param string   $menu_title The text to be used for the menu.
     1359 * @param string   $capability The capability required for this menu to be displayed to the user.
     1360 * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
     1361 * @param callable $function   The function to be called to output the content for this page.
     1362 * @param string   $icon_url   The url to the icon to be used for this menu.
     1363 * @return string The resulting page's hook_suffix.
     1364 */
     1365function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
     1366        _deprecated_function( __FUNCTION__, '4.5', 'add_menu_page()' );
     1367
     1368        global $_wp_last_utility_menu;
     1369
     1370        $_wp_last_utility_menu++;
     1371
     1372        return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_utility_menu);
     1373}
  • src/wp-admin/includes/plugin.php

    diff --git src/wp-admin/includes/plugin.php src/wp-admin/includes/plugin.php
    index 1dfc977..f194b13 100644
    function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $func 
    10801080}
    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 *
    11391085 * This function takes a capability which will be used to determine whether