Make WordPress Core


Ignore:
Timestamp:
10/07/2015 05:11:01 PM (9 years ago)
Author:
jeremyfelt
Message:

Revert [34778], continue using _site_option() for the current network.

The _network_option() parameter order will be changing to accept $network_id first. The _site_option() functions will remain in use throughout core as our way of retrieving a network option for the current network.

See #28290.

File:
1 edited

Legend:

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

    r34778 r34912  
    154154
    155155    if ( is_multisite() ) {
    156         $first_post = get_network_option( 'first_post' );
     156        $first_post = get_site_option( 'first_post' );
    157157
    158158        if ( empty($first_post) )
     
    190190To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.');
    191191    if ( is_multisite() ) {
    192         $first_comment_author = get_network_option( 'first_comment_author', $first_comment_author );
    193         $first_comment_url = get_network_option( 'first_comment_url', network_home_url() );
    194         $first_comment = get_network_option( 'first_comment', $first_comment );
     192        $first_comment_author = get_site_option( 'first_comment_author', $first_comment_author );
     193        $first_comment_url = get_site_option( 'first_comment_url', network_home_url() );
     194        $first_comment = get_site_option( 'first_comment', $first_comment );
    195195    }
    196196    $wpdb->insert( $wpdb->comments, array(
     
    215215As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to delete this page and create new pages for your content. Have fun!" ), admin_url() );
    216216    if ( is_multisite() )
    217         $first_page = get_network_option( 'first_page', $first_page );
     217        $first_page = get_site_option( 'first_page', $first_page );
    218218    $first_post_guid = get_option('home') . '/?page_id=2';
    219219    $wpdb->insert( $wpdb->posts, array(
     
    12561256        populate_roles_300();
    12571257
    1258     if ( $wp_current_db_version < 14139 && is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_network_option( 'siteurl' ) === false )
    1259         add_network_option( 'siteurl', '' );
     1258    if ( $wp_current_db_version < 14139 && is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false )
     1259        add_site_option( 'siteurl', '' );
    12601260
    12611261    // 3.0 screen options key name changes.
     
    16441644    // 2.8.
    16451645    if ( $wp_current_db_version < 11549 ) {
    1646         $wpmu_sitewide_plugins = get_network_option( 'wpmu_sitewide_plugins' );
    1647         $active_sitewide_plugins = get_network_option( 'active_sitewide_plugins' );
     1646        $wpmu_sitewide_plugins = get_site_option( 'wpmu_sitewide_plugins' );
     1647        $active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' );
    16481648        if ( $wpmu_sitewide_plugins ) {
    16491649            if ( !$active_sitewide_plugins )
     
    16521652                $sitewide_plugins = array_merge( (array) $active_sitewide_plugins, (array) $wpmu_sitewide_plugins );
    16531653
    1654             update_network_option( 'active_sitewide_plugins', $sitewide_plugins );
    1655         }
    1656         delete_network_option( 'wpmu_sitewide_plugins' );
    1657         delete_network_option( 'deactivated_sitewide_plugins' );
     1654            update_site_option( 'active_sitewide_plugins', $sitewide_plugins );
     1655        }
     1656        delete_site_option( 'wpmu_sitewide_plugins' );
     1657        delete_site_option( 'deactivated_sitewide_plugins' );
    16581658
    16591659        $start = 0;
     
    16641664                    $value = stripslashes( $value );
    16651665                if ( $value !== $row->meta_value ) {
    1666                     update_network_option( $row->meta_key, $value );
     1666                    update_site_option( $row->meta_key, $value );
    16671667                }
    16681668            }
     
    16731673    // 3.0
    16741674    if ( $wp_current_db_version < 13576 )
    1675         update_network_option( 'global_terms_enabled', '1' );
     1675        update_site_option( 'global_terms_enabled', '1' );
    16761676
    16771677    // 3.3
    16781678    if ( $wp_current_db_version < 19390 )
    1679         update_network_option( 'initial_db_version', $wp_current_db_version );
     1679        update_site_option( 'initial_db_version', $wp_current_db_version );
    16801680
    16811681    if ( $wp_current_db_version < 19470 ) {
    1682         if ( false === get_network_option( 'active_sitewide_plugins' ) )
    1683             update_network_option( 'active_sitewide_plugins', array() );
     1682        if ( false === get_site_option( 'active_sitewide_plugins' ) )
     1683            update_site_option( 'active_sitewide_plugins', array() );
    16841684    }
    16851685
     
    16871687    if ( $wp_current_db_version < 20148 ) {
    16881688        // 'allowedthemes' keys things by stylesheet. 'allowed_themes' keyed things by name.
    1689         $allowedthemes  = get_network_option( 'allowedthemes'  );
    1690         $allowed_themes = get_network_option( 'allowed_themes' );
     1689        $allowedthemes  = get_site_option( 'allowedthemes'  );
     1690        $allowed_themes = get_site_option( 'allowed_themes' );
    16911691        if ( false === $allowedthemes && is_array( $allowed_themes ) && $allowed_themes ) {
    16921692            $converted = array();
     
    16961696                    $converted[ $stylesheet ] = true;
    16971697            }
    1698             update_network_option( 'allowedthemes', $converted );
    1699             delete_network_option( 'allowed_themes' );
     1698            update_site_option( 'allowedthemes', $converted );
     1699            delete_site_option( 'allowed_themes' );
    17001700        }
    17011701    }
     
    17031703    // 3.5
    17041704    if ( $wp_current_db_version < 21823 )
    1705         update_network_option( 'ms_files_rewriting', '1' );
     1705        update_site_option( 'ms_files_rewriting', '1' );
    17061706
    17071707    // 3.5.2
    17081708    if ( $wp_current_db_version < 24448 ) {
    1709         $illegal_names = get_network_option( 'illegal_names' );
     1709        $illegal_names = get_site_option( 'illegal_names' );
    17101710        if ( is_array( $illegal_names ) && count( $illegal_names ) === 1 ) {
    17111711            $illegal_name = reset( $illegal_names );
    17121712            $illegal_names = explode( ' ', $illegal_name );
    1713             update_network_option( 'illegal_names', $illegal_names );
     1713            update_site_option( 'illegal_names', $illegal_names );
    17141714        }
    17151715    }
Note: See TracChangeset for help on using the changeset viewer.