Make WordPress Core


Ignore:
Timestamp:
06/14/2024 03:19:20 PM (2 weeks ago)
Author:
joemcgill
Message:

Options: Fix some default autoload values used in core.

This fixes some autoload values that were updated in [58105] that used the database values of "on" and "off" instead of the boolean values true and false when being passed to add|update_option().

Props joemcgill, desrosj, rajinsharwar.
Fixes #61045. See #42441.

File:
1 edited

Legend:

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

    r58380 r58416  
    15151515
    15161516        if ( false === get_option( $transient_option ) ) {
    1517             $autoload = 'on';
     1517            $autoload = true;
    15181518            if ( $expiration ) {
    1519                 $autoload = 'off';
    1520                 add_option( $transient_timeout, time() + $expiration, '', 'off' );
     1519                $autoload = false;
     1520                add_option( $transient_timeout, time() + $expiration, '', false );
    15211521            }
    15221522            $result = add_option( $transient_option, $value, '', $autoload );
     
    15311531                if ( false === get_option( $transient_timeout ) ) {
    15321532                    delete_option( $transient_option );
    1533                     add_option( $transient_timeout, time() + $expiration, '', 'off' );
    1534                     $result = add_option( $transient_option, $value, '', 'off' );
     1533                    add_option( $transient_timeout, time() + $expiration, '', false );
     1534                    $result = add_option( $transient_option, $value, '', false );
    15351535                    $update = false;
    15361536                } else {
     
    21202120
    21212121    if ( ! is_multisite() ) {
    2122         $result = add_option( $option, $value, '', 'off' );
     2122        $result = add_option( $option, $value, '', false );
    21232123    } else {
    21242124        $cache_key = "$network_id:$option";
     
    23662366
    23672367    if ( ! is_multisite() ) {
    2368         $result = update_option( $option, $value, 'off' );
     2368        $result = update_option( $option, $value, false );
    23692369    } else {
    23702370        $value = sanitize_option( $option, $value );
Note: See TracChangeset for help on using the changeset viewer.