Make WordPress Core


Ignore:
Timestamp:
08/28/2024 04:39:30 PM (20 months ago)
Author:
flixos90
Message:

Options, Meta APIs: Stop using 'yes' and 'no' for autoload parameter in favor of recommended boolean.

This changeset does not modify any behavior, it only updates the code to use the recommended type for the $autoload parameter as of WordPress 6.6. The old values 'yes' and 'no' are only maintained in certain tests that are explicitly about these backward compatibility values.

Props flixos90, joemcgill, mukesh27.
Fixes #61939.
See #61103, #61929.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/option/wpLoadAlloptions.php

    r57920 r58945  
    2727    public function test_default_and_yes() {
    2828        add_option( 'foo', 'bar' );
    29         add_option( 'bar', 'foo', '', 'yes' );
     29        add_option( 'bar', 'foo', '', true );
    3030        $alloptions = wp_load_alloptions();
    3131        $this->assertArrayHasKey( 'foo', $alloptions );
     
    4040    public function test_default_and_no() {
    4141        add_option( 'foo', 'bar' );
    42         add_option( 'bar', 'foo', '', 'no' );
     42        add_option( 'bar', 'foo', '', false );
    4343        $alloptions = wp_load_alloptions();
    4444        $this->assertArrayHasKey( 'foo', $alloptions );
Note: See TracChangeset for help on using the changeset viewer.