WordPress.org

Make WordPress Core

Changeset 21536


Ignore:
Timestamp:
08/16/2012 11:08:07 PM (7 years ago)
Author:
nacin
Message:

Disable the Link Manager on any future upgrade if it is still enabled but there are no links. see #21307.

File:
1 edited

Legend:

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

    r21501 r21536  
    402402    if ( $wp_current_db_version < 21501 )
    403403        upgrade_350();
     404
     405    maybe_disable_link_manager();
    404406
    405407    maybe_disable_automattic_widgets();
     
    19091911
    19101912/**
    1911  * {@internal Missing Short Description}}
    1912  *
    1913  * {@internal Missing Long Description}}
     1913 * Disables the Automattic widgets plugin, which was merged into core.
    19141914 *
    19151915 * @since 2.2.0
     
    19251925        }
    19261926    }
     1927}
     1928
     1929/**
     1930 * Disables the Link Manager on upgrade, if at the time of upgrade, no links exist in the DB.
     1931 *
     1932 * @since 3.5.0
     1933 */
     1934function maybe_disable_link_manager() {
     1935    global $wp_current_db_version, $wpdb;
     1936
     1937    if ( $wp_current_db_version >= 21501 && get_option( 'link_manager_enabled' ) && ! $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) )
     1938        update_option( 'link_manager_enabled', 0 );
    19271939}
    19281940
Note: See TracChangeset for help on using the changeset viewer.