Make WordPress Core


Ignore:
Timestamp:
10/02/2015 07:07:23 PM (11 years ago)
Author:
jeremyfelt
Message:

MS: Use *_network_option() functions throughout core.

Replaces all uses of *_site_option() with the corresponding "network" function.

This excludes one usage in wp-admin/admin-footer.php that needs more investigation.

Props spacedmonkey.
See #28290.

File:
1 edited

Legend:

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

    r34751 r34778  
    23692369                        return false;
    23702370
    2371                 $failure_data = get_site_option( 'auto_core_update_failed' );
     2371                $failure_data = get_network_option( 'auto_core_update_failed' );
    23722372                if ( $failure_data ) {
    23732373                        // If this was a critical update failure, cannot update.
    … …  
    27812781         */
    27822782        protected function send_core_update_notification_email( $item ) {
    2783                 $notified = get_site_option( 'auto_core_update_notified' );
     2783                $notified = get_network_option( 'auto_core_update_notified' );
    27842784
    27852785                // Don't notify if we've already notified the same email address of the same version.
    2786                 if ( $notified && $notified['email'] == get_site_option( 'admin_email' ) && $notified['version'] == $item->current )
     2786                if ( $notified && $notified['email'] == get_network_option( 'admin_email' ) && $notified['version'] == $item->current )
    27872787                        return false;
    27882788
    … …  
    31093109                                $critical_data['rollback_data'] = $rollback_result->get_error_data();
    31103110                        }
    3111                         update_site_option( 'auto_core_update_failed', $critical_data );
     3111                        update_network_option( 'auto_core_update_failed', $critical_data );
    31123112                        $this->send_email( 'critical', $core_update, $result );
    31133113                        return;
    … …  
    31273127                $send = true;
    31283128                $transient_failures = array( 'incompatible_archive', 'download_failed', 'insane_distro' );
    3129                 if ( in_array( $error_code, $transient_failures ) && ! get_site_option( 'auto_core_update_failed' ) ) {
     3129                if ( in_array( $error_code, $transient_failures ) && ! get_network_option( 'auto_core_update_failed' ) ) {
    31303130                        wp_schedule_single_event( time() + HOUR_IN_SECONDS, 'wp_maybe_auto_update' );
    31313131                        $send = false;
    31323132                }
    31333133
    3134                 $n = get_site_option( 'auto_core_update_notified' );
     3134                $n = get_network_option( 'auto_core_update_notified' );
    31353135                // Don't notify if we've already notified the same email address of the same version of the same notification type.
    3136                 if ( $n && 'fail' == $n['type'] && $n['email'] == get_site_option( 'admin_email' ) && $n['version'] == $core_update->current )
     3136                if ( $n && 'fail' == $n['type'] && $n['email'] == get_network_option( 'admin_email' ) && $n['version'] == $core_update->current )
    31373137                        $send = false;
    31383138
    3139                 update_site_option( 'auto_core_update_failed', array(
     3139                update_network_option( 'auto_core_update_failed', array(
    31403140                        'attempted'  => $core_update->current,
    31413141                        'current'    => $wp_version,
    … …  
    31633163         */
    31643164        protected function send_email( $type, $core_update, $result = null ) {
    3165                 update_site_option( 'auto_core_update_notified', array(
     3165                update_network_option( 'auto_core_update_notified', array(
    31663166                        'type'      => $type,
    3167                         'email'     => get_site_option( 'admin_email' ),
     3167                        'email'     => get_network_option( 'admin_email' ),
    31683168                        'version'   => $core_update->current,
    31693169                        'timestamp' => time(),
    … …  
    33213321                }
    33223322
    3323                 $to  = get_site_option( 'admin_email' );
     3323                $to  = get_network_option( 'admin_email' );
    33243324                $headers = '';
    33253325
    … …  
    34953495
    34963496                $email = array(
    3497                         'to'      => get_site_option( 'admin_email' ),
     3497                        'to'      => get_network_option( 'admin_email' ),
    34983498                        'subject' => $subject,
    34993499                        'body'    => implode( "\n", $body ),
Note: See TracChangeset for help on using the changeset viewer.