mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
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 Built from https://develop.svn.wordpress.org/trunk@25307 git-svn-id: http://core.svn.wordpress.org/trunk@25269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
023a4c7336
commit
2caf5fe381
@ -1053,3 +1053,66 @@ function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
|
|||||||
function wp_nav_menu_locations_meta_box() {
|
function wp_nav_menu_locations_meta_box() {
|
||||||
_deprecated_function( __FUNCTION__, '3.6' );
|
_deprecated_function( __FUNCTION__, '3.6' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This was once used to kick-off the Core Updater.
|
||||||
|
*
|
||||||
|
* Deprecated in favor of instantating a Core_Upgrader instance directly,
|
||||||
|
* and calling the 'upgrade' method.
|
||||||
|
*
|
||||||
|
* @since 2.7.0
|
||||||
|
* @deprecated 3.7.0
|
||||||
|
*/
|
||||||
|
function wp_update_core($current, $feedback = '') {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.7', 'new Core_Upgrader();' );
|
||||||
|
|
||||||
|
if ( !empty($feedback) )
|
||||||
|
add_filter('update_feedback', $feedback);
|
||||||
|
|
||||||
|
include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||||
|
$upgrader = new Core_Upgrader();
|
||||||
|
return $upgrader->upgrade($current);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This was once used to kick-off the Plugin Updater.
|
||||||
|
*
|
||||||
|
* Deprecated in favor of instantating a Plugin_Upgrader instance directly,
|
||||||
|
* and calling the 'upgrade' method.
|
||||||
|
* Unused since 2.8.0.
|
||||||
|
*
|
||||||
|
* @since 2.5.0
|
||||||
|
* @deprecated 3.7.0
|
||||||
|
*/
|
||||||
|
function wp_update_plugin($plugin, $feedback = '') {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.7', 'new Plugin_Upgrader();' );
|
||||||
|
|
||||||
|
if ( !empty($feedback) )
|
||||||
|
add_filter('update_feedback', $feedback);
|
||||||
|
|
||||||
|
include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||||
|
$upgrader = new Plugin_Upgrader();
|
||||||
|
return $upgrader->upgrade($plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This was once used to kick-off the Plugin Updater.
|
||||||
|
*
|
||||||
|
* Deprecated in favor of instantating a Plugin_Upgrader instance directly,
|
||||||
|
* and calling the 'upgrade' method.
|
||||||
|
* Unused since 2.8.0.
|
||||||
|
*
|
||||||
|
* @since 2.7.0
|
||||||
|
* @deprecated 3.7.0
|
||||||
|
*/
|
||||||
|
function wp_update_theme($theme, $feedback = '') {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.7', 'new Theme_Upgrader();' );
|
||||||
|
|
||||||
|
if ( !empty($feedback) )
|
||||||
|
add_filter('update_feedback', $feedback);
|
||||||
|
|
||||||
|
include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||||
|
$upgrader = new Theme_Upgrader();
|
||||||
|
return $upgrader->upgrade($theme);
|
||||||
|
}
|
||||||
|
@ -873,7 +873,7 @@ function _redirect_to_about_wordpress( $new_version ) {
|
|||||||
if ( version_compare( $wp_version, '3.4-RC1', '>=' ) )
|
if ( version_compare( $wp_version, '3.4-RC1', '>=' ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Ensure we only run this on the update-core.php page. wp_update_core() could be called in other contexts.
|
// Ensure we only run this on the update-core.php page. The Core_Upgrader may be used in other contexts.
|
||||||
if ( 'update-core.php' != $pagenow )
|
if ( 'update-core.php' != $pagenow )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
* @subpackage Administration
|
* @subpackage Administration
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// The admin side of our 1.1 update system
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Selects the first update version from the update_core option
|
* Selects the first update version from the update_core option
|
||||||
*
|
*
|
||||||
@ -220,15 +218,6 @@ function wp_plugin_update_row( $file, $plugin_data ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function wp_update_plugin($plugin, $feedback = '') {
|
|
||||||
if ( !empty($feedback) )
|
|
||||||
add_filter('update_feedback', $feedback);
|
|
||||||
|
|
||||||
include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
|
||||||
$upgrader = new Plugin_Upgrader();
|
|
||||||
return $upgrader->upgrade($plugin);
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_theme_updates() {
|
function get_theme_updates() {
|
||||||
$themes = wp_get_themes();
|
$themes = wp_get_themes();
|
||||||
$current = get_site_transient('update_themes');
|
$current = get_site_transient('update_themes');
|
||||||
@ -245,15 +234,6 @@ function get_theme_updates() {
|
|||||||
return $update_themes;
|
return $update_themes;
|
||||||
}
|
}
|
||||||
|
|
||||||
function wp_update_theme($theme, $feedback = '') {
|
|
||||||
if ( !empty($feedback) )
|
|
||||||
add_filter('update_feedback', $feedback);
|
|
||||||
|
|
||||||
include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
|
||||||
$upgrader = new Theme_Upgrader();
|
|
||||||
return $upgrader->upgrade($theme);
|
|
||||||
}
|
|
||||||
|
|
||||||
function wp_theme_update_rows() {
|
function wp_theme_update_rows() {
|
||||||
if ( !current_user_can('update_themes' ) )
|
if ( !current_user_can('update_themes' ) )
|
||||||
return;
|
return;
|
||||||
@ -294,16 +274,6 @@ function wp_theme_update_row( $theme_key, $theme ) {
|
|||||||
echo '</div></td></tr>';
|
echo '</div></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function wp_update_core($current, $feedback = '') {
|
|
||||||
if ( !empty($feedback) )
|
|
||||||
add_filter('update_feedback', $feedback);
|
|
||||||
|
|
||||||
include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
|
||||||
$upgrader = new Core_Upgrader();
|
|
||||||
return $upgrader->upgrade($current);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function maintenance_nag() {
|
function maintenance_nag() {
|
||||||
global $upgrading;
|
global $upgrading;
|
||||||
if ( ! isset( $upgrading ) )
|
if ( ! isset( $upgrading ) )
|
||||||
|
@ -314,6 +314,8 @@ function list_theme_updates() {
|
|||||||
function do_core_upgrade( $reinstall = false ) {
|
function do_core_upgrade( $reinstall = false ) {
|
||||||
global $wp_filesystem;
|
global $wp_filesystem;
|
||||||
|
|
||||||
|
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||||
|
|
||||||
if ( $reinstall )
|
if ( $reinstall )
|
||||||
$url = 'update-core.php?action=do-core-reinstall';
|
$url = 'update-core.php?action=do-core-reinstall';
|
||||||
else
|
else
|
||||||
@ -347,7 +349,10 @@ function do_core_upgrade( $reinstall = false ) {
|
|||||||
if ( $reinstall )
|
if ( $reinstall )
|
||||||
$update->response = 'reinstall';
|
$update->response = 'reinstall';
|
||||||
|
|
||||||
$result = wp_update_core($update, 'show_message');
|
add_filter( 'update_feedback', 'show_message' );
|
||||||
|
|
||||||
|
$upgrader = new Core_Upgrader();
|
||||||
|
$result = $upgrader->upgrade( $update );
|
||||||
|
|
||||||
if ( is_wp_error($result) ) {
|
if ( is_wp_error($result) ) {
|
||||||
show_message($result);
|
show_message($result);
|
||||||
|
Loading…
Reference in New Issue
Block a user