Make WordPress Core


Ignore:
Timestamp:
10/07/2015 05:11:01 PM (11 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-includes/option.php

    r34878 r34912  
    8989                                } else { // option does not exist, so we must cache its non-existence
    9090                                        if ( ! is_array( $notoptions ) ) {
    91                                                 $notoptions = array();
     91                                                 $notoptions = array();
    9292                                        }
    9393                                        $notoptions[$option] = true;
    … …  
    14811481                $option_timeout = '_site_transient_timeout_' . $transient;
    14821482                $option = '_site_transient_' . $transient;
    1483                 $result = delete_network_option( $option );
     1483                $result = delete_site_option( $option );
    14841484                if ( $result )
    1485                         delete_network_option( $option_timeout );
     1485                        delete_site_option( $option_timeout );
    14861486        }
    14871487        if ( $result ) {
    … …  
    15441544                if ( ! in_array( $transient, $no_timeout ) ) {
    15451545                        $transient_timeout = '_site_transient_timeout_' . $transient;
    1546                         $timeout = get_network_option( $transient_timeout );
     1546                        $timeout = get_site_option( $transient_timeout );
    15471547                        if ( false !== $timeout && $timeout < time() ) {
    1548                                 delete_network_option( $transient_option  );
    1549                                 delete_network_option( $transient_timeout );
     1548                                delete_site_option( $transient_option  );
     1549                                delete_site_option( $transient_timeout );
    15501550                                $value = false;
    15511551                        }
    … …  
    15531553
    15541554                if ( ! isset( $value ) )
    1555                         $value = get_network_option( $transient_option );
     1555                        $value = get_site_option( $transient_option );
    15561556        }
    15571557
    … …  
    16211621                $transient_timeout = '_site_transient_timeout_' . $transient;
    16221622                $option = '_site_transient_' . $transient;
    1623                 if ( false === get_network_option( $option ) ) {
     1623                if ( false === get_site_option( $option ) ) {
    16241624                        if ( $expiration )
    1625                                 add_network_option( $transient_timeout, time() + $expiration );
    1626                         $result = add_network_option( $option, $value );
     1625                                add_site_option( $transient_timeout, time() + $expiration );
     1626                        $result = add_site_option( $option, $value );
    16271627                } else {
    16281628                        if ( $expiration )
    1629                                 update_network_option( $transient_timeout, time() + $expiration );
    1630                         $result = update_network_option( $option, $value );
     1629                                update_site_option( $transient_timeout, time() + $expiration );
     1630                        $result = update_site_option( $option, $value );
    16311631                }
    16321632        }
Note: See TracChangeset for help on using the changeset viewer.