Make WordPress Core

Changeset 58416


Ignore:
Timestamp:
06/14/2024 03:19:20 PM (2 years 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.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r58287 r58416  
    193193                        update_site_option( 'can_compress_scripts', 0 );
    194194                } else {
    195                         update_option( 'can_compress_scripts', 0, 'on' );
     195                        update_option( 'can_compress_scripts', 0, true );
    196196                }
    197197                wp_die( 0 );
     
    232232                                update_site_option( 'can_compress_scripts', 0 );
    233233                        } else {
    234                                 update_option( 'can_compress_scripts', 0, 'on' );
     234                                update_option( 'can_compress_scripts', 0, true );
    235235                        }
    236236                } elseif ( 'yes' === $_GET['test'] ) {
     
    240240                                update_site_option( 'can_compress_scripts', 1 );
    241241                        } else {
    242                                 update_option( 'can_compress_scripts', 1, 'on' );
     242                                update_option( 'can_compress_scripts', 1, true );
    243243                        }
    244244                }
  • 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.