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/src/wp-admin/includes/upgrade.php

    r58810 r58945  
    18451845            $uninstall_plugins = get_option( 'uninstall_plugins' );
    18461846            delete_option( 'uninstall_plugins' );
    1847             add_option( 'uninstall_plugins', $uninstall_plugins, null, 'no' );
     1847            add_option( 'uninstall_plugins', $uninstall_plugins, null, false );
    18481848        }
    18491849    }
     
    23412341            if ( false !== $can_compress_scripts ) {
    23422342                delete_option( 'can_compress_scripts' );
    2343                 add_option( 'can_compress_scripts', $can_compress_scripts, '', 'yes' );
     2343                add_option( 'can_compress_scripts', $can_compress_scripts, '', true );
    23442344            }
    23452345        }
     
    23942394        );
    23952395
    2396         $autoload = array_fill_keys( $theme_mods_options, 'no' );
     2396        $autoload = array_fill_keys( $theme_mods_options, false );
    23972397        wp_set_option_autoload_values( $autoload );
    23982398    }
Note: See TracChangeset for help on using the changeset viewer.