Make WordPress Core


Ignore:
Timestamp:
04/16/2016 07:47:14 PM (9 years ago)
Author:
jeremyfelt
Message:

Options: Do not set network options to autoload in single site

When multisite is not configured, the _site_transient() and _site_option() functions fallback to _option() and store network "meta/options" in wp_options.

Previously, those calls to _option() did not explicitly set the autoload parameter and anything assigned as a transient or option at the network level would be set to autoload by default, even though autoload is not yet a concept at the network option level.

This changes that behavior and forces the autoload setting to no. If autoload is desired, the single site option functions should be used.

Props thomaswm.
Fixes #22846.

File:
1 edited

Legend:

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

    r36234 r37223  
    12241224
    12251225    if ( ! is_multisite() ) {
    1226         $result = add_option( $option, $value );
     1226        $result = add_option( $option, $value, '', 'no' );
    12271227    } else {
    12281228        $cache_key = "$network_id:$option";
     
    14321432
    14331433    if ( ! is_multisite() ) {
    1434         $result = update_option( $option, $value );
     1434        $result = update_option( $option, $value, 'no' );
    14351435    } else {
    14361436        $value = sanitize_option( $option, $value );
Note: See TracChangeset for help on using the changeset viewer.