WordPress.org

Make WordPress Core

Changeset 25307


Ignore:
Timestamp:
09/09/2013 06:44:25 AM (5 years ago)
Author:
dd32
Message:

Upgrader: Deprecate a few mostly unused functions, wp_update_plugin(), wp_update_theme(), and, wp_update_core().
wp_update_core() was still used, as it was never updated to make use of the newer Skins. Fixes #21874

Location:
trunk/src/wp-admin
Files:
4 edited

Legend:

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

    r25209 r25307  
    10541054    _deprecated_function( __FUNCTION__, '3.6' );   
    10551055}
     1056
     1057/**
     1058 * This was once used to kick-off the Core Updater.
     1059 *
     1060 * Deprecated in favor of instantating a Core_Upgrader instance directly,
     1061 * and calling the 'upgrade' method.
     1062 *
     1063 * @since 2.7.0
     1064 * @deprecated 3.7.0
     1065 */
     1066function wp_update_core($current, $feedback = '') {
     1067    _deprecated_function( __FUNCTION__, '3.7', 'new Core_Upgrader();' );
     1068
     1069    if ( !empty($feedback) )
     1070        add_filter('update_feedback', $feedback);
     1071
     1072    include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     1073    $upgrader = new Core_Upgrader();
     1074    return $upgrader->upgrade($current);
     1075
     1076}
     1077
     1078/**
     1079 * This was once used to kick-off the Plugin Updater.
     1080 *
     1081 * Deprecated in favor of instantating a Plugin_Upgrader instance directly,
     1082 * and calling the 'upgrade' method.
     1083 * Unused since 2.8.0.
     1084 *
     1085 * @since 2.5.0
     1086 * @deprecated 3.7.0
     1087 */
     1088function wp_update_plugin($plugin, $feedback = '') {
     1089    _deprecated_function( __FUNCTION__, '3.7', 'new Plugin_Upgrader();' );
     1090
     1091    if ( !empty($feedback) )
     1092        add_filter('update_feedback', $feedback);
     1093
     1094    include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     1095    $upgrader = new Plugin_Upgrader();
     1096    return $upgrader->upgrade($plugin);
     1097}
     1098
     1099/**
     1100 * This was once used to kick-off the Plugin Updater.
     1101 *
     1102 * Deprecated in favor of instantating a Plugin_Upgrader instance directly,
     1103 * and calling the 'upgrade' method.
     1104 * Unused since 2.8.0.
     1105 *
     1106 * @since 2.7.0
     1107 * @deprecated 3.7.0
     1108 */
     1109function wp_update_theme($theme, $feedback = '') {
     1110    _deprecated_function( __FUNCTION__, '3.7', 'new Theme_Upgrader();' );
     1111
     1112    if ( !empty($feedback) )
     1113        add_filter('update_feedback', $feedback);
     1114
     1115    include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     1116    $upgrader = new Theme_Upgrader();
     1117    return $upgrader->upgrade($theme);
     1118}
  • trunk/src/wp-admin/includes/update-core.php

    r25020 r25307  
    874874        return;
    875875
    876     // Ensure we only run this on the update-core.php page. wp_update_core() could be called in other contexts.
     876    // Ensure we only run this on the update-core.php page. The Core_Upgrader may be used in other contexts.
    877877    if ( 'update-core.php' != $pagenow )
    878878        return;
  • trunk/src/wp-admin/includes/update.php

    r25256 r25307  
    66 * @subpackage Administration
    77 */
    8 
    9 // The admin side of our 1.1 update system
    108
    119/**
     
    221219}
    222220
    223 function wp_update_plugin($plugin, $feedback = '') {
    224     if ( !empty($feedback) )
    225         add_filter('update_feedback', $feedback);
    226 
    227     include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    228     $upgrader = new Plugin_Upgrader();
    229     return $upgrader->upgrade($plugin);
    230 }
    231 
    232221function get_theme_updates() {
    233222    $themes = wp_get_themes();
     
    244233
    245234    return $update_themes;
    246 }
    247 
    248 function wp_update_theme($theme, $feedback = '') {
    249     if ( !empty($feedback) )
    250         add_filter('update_feedback', $feedback);
    251 
    252     include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    253     $upgrader = new Theme_Upgrader();
    254     return $upgrader->upgrade($theme);
    255235}
    256236
     
    295275}
    296276
    297 function wp_update_core($current, $feedback = '') {
    298     if ( !empty($feedback) )
    299         add_filter('update_feedback', $feedback);
    300 
    301     include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    302     $upgrader = new Core_Upgrader();
    303     return $upgrader->upgrade($current);
    304 
    305 }
    306 
    307277function maintenance_nag() {
    308278    global $upgrading;
  • trunk/src/wp-admin/update-core.php

    r25219 r25307  
    315315    global $wp_filesystem;
    316316
     317    include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     318
    317319    if ( $reinstall )
    318320        $url = 'update-core.php?action=do-core-reinstall';
     
    348350        $update->response = 'reinstall';
    349351
    350     $result = wp_update_core($update, 'show_message');
     352    add_filter( 'update_feedback', 'show_message' );
     353
     354    $upgrader = new Core_Upgrader();
     355    $result = $upgrader->upgrade( $update );
    351356
    352357    if ( is_wp_error($result) ) {
Note: See TracChangeset for help on using the changeset viewer.