mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-21 22:15:28 +00:00
Plugins: Clean up uninstall_plugins
option during database upgrade.
`register_uninstall_hook()` is designed to be given a function callback (or a static class variable), not an array/object instance. This got blocked in [16339] but the option itself was never cleaned up. Props polevaultweb. Fixes #31625. Built from https://develop.svn.wordpress.org/trunk@37965 git-svn-id: http://core.svn.wordpress.org/trunk@37906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
56e463a38e
commit
4594006ca6
@ -555,7 +555,7 @@ function upgrade_all() {
|
||||
if ( $wp_current_db_version < 36686 )
|
||||
upgrade_450();
|
||||
|
||||
if ( $wp_current_db_version < 37854 )
|
||||
if ( $wp_current_db_version < 37965 )
|
||||
upgrade_460();
|
||||
|
||||
maybe_disable_link_manager();
|
||||
@ -1699,11 +1699,30 @@ function upgrade_450() {
|
||||
* @ignore
|
||||
* @since 4.6.0
|
||||
*
|
||||
* @global int $wp_current_db_version Current database version.
|
||||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
* @global int $wp_current_db_version Current database version.
|
||||
*/
|
||||
function upgrade_460() {
|
||||
delete_post_meta_by_key( '_post_restored_from' );
|
||||
global $wp_current_db_version;
|
||||
|
||||
// Remove unused post meta.
|
||||
if ( $wp_current_db_version < 37854 ) {
|
||||
delete_post_meta_by_key( '_post_restored_from' );
|
||||
}
|
||||
|
||||
// Remove plugins with callback as an array object/method as the uninstall hook, see #13786.
|
||||
if ( $wp_current_db_version < 37965 ) {
|
||||
$uninstall_plugins = get_option( 'uninstall_plugins', array() );
|
||||
|
||||
if ( ! empty( $uninstall_plugins ) ) {
|
||||
foreach ( $uninstall_plugins as $basename => $callback ) {
|
||||
if ( is_array( $callback ) && is_object( $callback[0] ) ) {
|
||||
unset( $uninstall_plugins[ $basename ] );
|
||||
}
|
||||
}
|
||||
|
||||
update_option( 'uninstall_plugins', $uninstall_plugins );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,14 +4,14 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.6-beta1-37964';
|
||||
$wp_version = '4.6-beta1-37965';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
*
|
||||
* @global int $wp_db_version
|
||||
*/
|
||||
$wp_db_version = 37854;
|
||||
$wp_db_version = 37965;
|
||||
|
||||
/**
|
||||
* Holds the TinyMCE version
|
||||
|
Loading…
x
Reference in New Issue
Block a user