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-includes/option.php

    r34777 r34778  
    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;
     
    14671467        $option_timeout = '_site_transient_timeout_' . $transient;
    14681468        $option = '_site_transient_' . $transient;
    1469         $result = delete_site_option( $option );
     1469        $result = delete_network_option( $option );
    14701470        if ( $result )
    1471             delete_site_option( $option_timeout );
     1471            delete_network_option( $option_timeout );
    14721472    }
    14731473    if ( $result ) {
     
    15301530        if ( ! in_array( $transient, $no_timeout ) ) {
    15311531            $transient_timeout = '_site_transient_timeout_' . $transient;
    1532             $timeout = get_site_option( $transient_timeout );
     1532            $timeout = get_network_option( $transient_timeout );
    15331533            if ( false !== $timeout && $timeout < time() ) {
    1534                 delete_site_option( $transient_option  );
    1535                 delete_site_option( $transient_timeout );
     1534                delete_network_option( $transient_option  );
     1535                delete_network_option( $transient_timeout );
    15361536                $value = false;
    15371537            }
     
    15391539
    15401540        if ( ! isset( $value ) )
    1541             $value = get_site_option( $transient_option );
     1541            $value = get_network_option( $transient_option );
    15421542    }
    15431543
     
    15941594        $transient_timeout = '_site_transient_timeout_' . $transient;
    15951595        $option = '_site_transient_' . $transient;
    1596         if ( false === get_site_option( $option ) ) {
     1596        if ( false === get_network_option( $option ) ) {
    15971597            if ( $expiration )
    1598                 add_site_option( $transient_timeout, time() + $expiration );
    1599             $result = add_site_option( $option, $value );
     1598                add_network_option( $transient_timeout, time() + $expiration );
     1599            $result = add_network_option( $option, $value );
    16001600        } else {
    16011601            if ( $expiration )
    1602                 update_site_option( $transient_timeout, time() + $expiration );
    1603             $result = update_site_option( $option, $value );
     1602                update_network_option( $transient_timeout, time() + $expiration );
     1603            $result = update_network_option( $option, $value );
    16041604        }
    16051605    }
Note: See TracChangeset for help on using the changeset viewer.