WordPress.org

Make WordPress Core

Ticket #31625: 31625.diff

File 31625.diff, 1.2 KB (added by polevaultweb, 4 years ago)

Upgrade routine added

  • src/wp-admin/includes/upgrade.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    552552        if ( $wp_current_db_version < 36686 )
    553553                upgrade_450();
    554554
     555        if ( $wp_current_db_version < 36999 )
     556                upgrade_460();
     557
    555558        maybe_disable_link_manager();
    556559
    557560        maybe_disable_automattic_widgets();
     
    16851688
    16861689        // Remove unused user setting for wpLink.
    16871690        delete_user_setting( 'wplink' );
     1691}
     1692
     1693/**
     1694 * Execute changes made in WordPress 4.6.0
     1695 *
     1696 * @ignore
     1697 * @since 4.6.0
     1698 */
     1699function upgrade_460() {
     1700        // Remove plugins with callback as an array object/method as the uninstall hook
     1701        $uninstall_plugins = get_option( 'uninstall_plugins' );
     1702        $update            = false;
     1703        foreach ( $uninstall_plugins as $basename => $callback ) {
     1704                if ( is_array( $callback ) && is_object( $callback[0] ) ) {
     1705                        unset( $uninstall_plugins[ $basename ] );
     1706                        $update = true;
     1707                }
     1708        }
     1709       
     1710        if ( $update ) {
     1711                update_option( 'uninstall_plugins', $uninstall_plugins );
     1712        }
    16881713}
    16891714
    16901715/**