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/ms.php

    r34778 r34912  
    1717 */
    1818function check_upload_size( $file ) {
    19     if ( get_network_option( 'upload_space_check_disabled' ) )
     19    if ( get_site_option( 'upload_space_check_disabled' ) )
    2020        return $file;
    2121
     
    3131    if ( $space_left < $file_size )
    3232        $file['error'] = sprintf( __( 'Not enough space to upload. %1$s KB needed.' ), number_format( ($file_size - $space_left) /1024 ) );
    33     if ( $file_size > ( 1024 * get_network_option( 'fileupload_maxk', 1500 ) ) )
    34         $file['error'] = sprintf(__('This file is too big. Files must be less than %1$s KB in size.'), get_network_option( 'fileupload_maxk', 1500 ) );
     33    if ( $file_size > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) )
     34        $file['error'] = sprintf(__('This file is too big. Files must be less than %1$s KB in size.'), get_site_option( 'fileupload_maxk', 1500 ) );
    3535    if ( upload_is_user_over_quota( false ) ) {
    3636        $file['error'] = __( 'You have used your space quota. Please delete files before uploading.' );
     
    9999
    100100    // If ms_files_rewriting is enabled and upload_path is empty, wp_upload_dir is not reliable.
    101     if ( $drop && get_network_option( 'ms_files_rewriting' ) && empty( $upload_path ) ) {
     101    if ( $drop && get_site_option( 'ms_files_rewriting' ) && empty( $upload_path ) ) {
    102102        $drop = false;
    103103    }
     
    307307    $content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'options.php?adminhash='.$hash ) ), $content );
    308308    $content = str_replace( '###EMAIL###', $value, $content );
    309     $content = str_replace( '###SITENAME###', get_network_option( 'site_name' ), $content );
     309    $content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content );
    310310    $content = str_replace( '###SITEURL###', network_home_url(), $content );
    311311
     
    386386        $content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'profile.php?newuseremail='.$hash ) ), $content );
    387387        $content = str_replace( '###EMAIL###', $_POST['email'], $content);
    388         $content = str_replace( '###SITENAME###', get_network_option( 'site_name' ), $content );
     388        $content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content );
    389389        $content = str_replace( '###SITEURL###', network_home_url(), $content );
    390390
     
    414414 */
    415415function upload_is_user_over_quota( $echo = true ) {
    416     if ( get_network_option( 'upload_space_check_disabled' ) )
     416    if ( get_site_option( 'upload_space_check_disabled' ) )
    417417        return false;
    418418
     
    747747    if ( !is_super_admin() )
    748748        return false;
    749     if ( get_network_option( 'wpmu_upgrade_site' ) != $wp_db_version )
     749    if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version )
    750750        echo "<div class='update-nag'>" . sprintf( __( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) ) . "</div>";
    751751}
     
    829829        </td>
    830830    </tr>
    831     <?php if ( in_array( get_network_option( 'registration' ), array( 'all', 'blog' ) ) ) : ?>
     831    <?php if ( in_array( get_site_option( 'registration' ), array( 'all', 'blog' ) ) ) : ?>
    832832        <tr>
    833833            <th scope="row" colspan="2" class="th-full">
     
    871871
    872872    // Directly fetch site_admins instead of using get_super_admins()
    873     $super_admins = get_network_option( 'site_admins', array( 'admin' ) );
     873    $super_admins = get_site_option( 'site_admins', array( 'admin' ) );
    874874
    875875    $user = get_userdata( $user_id );
    876876    if ( $user && ! in_array( $user->user_login, $super_admins ) ) {
    877877        $super_admins[] = $user->user_login;
    878         update_network_option( 'site_admins' , $super_admins );
     878        update_site_option( 'site_admins' , $super_admins );
    879879
    880880        /**
     
    918918
    919919    // Directly fetch site_admins instead of using get_super_admins()
    920     $super_admins = get_network_option( 'site_admins', array( 'admin' ) );
     920    $super_admins = get_site_option( 'site_admins', array( 'admin' ) );
    921921
    922922    $user = get_userdata( $user_id );
    923     if ( $user && 0 !== strcasecmp( $user->user_email, get_network_option( 'admin_email' ) ) ) {
     923    if ( $user && 0 !== strcasecmp( $user->user_email, get_site_option( 'admin_email' ) ) ) {
    924924        if ( false !== ( $key = array_search( $user->user_login, $super_admins ) ) ) {
    925925            unset( $super_admins[$key] );
    926             update_network_option( 'site_admins', $super_admins );
     926            update_site_option( 'site_admins', $super_admins );
    927927
    928928            /**
Note: See TracChangeset for help on using the changeset viewer.