mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 09:07:59 +01:00
Options: Update default autoload values used in core.
This updates the values used for the `$autoload` parameter in various functions to replace 'yes' and 'no' with 'on' and 'off', respectively. Follow-up to [57920]. Props pbearne, mukesh27, joemcgill. Fixes #61045. See #42441. Built from https://develop.svn.wordpress.org/trunk@58105 git-svn-id: http://core.svn.wordpress.org/trunk@57570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
70ba8a1e2c
commit
ae2ce86cf4
@ -192,7 +192,7 @@ function wp_ajax_wp_compression_test() {
|
||||
if ( is_multisite() ) {
|
||||
update_site_option( 'can_compress_scripts', 0 );
|
||||
} else {
|
||||
update_option( 'can_compress_scripts', 0, 'yes' );
|
||||
update_option( 'can_compress_scripts', 0, 'on' );
|
||||
}
|
||||
wp_die( 0 );
|
||||
}
|
||||
@ -231,7 +231,7 @@ function wp_ajax_wp_compression_test() {
|
||||
if ( is_multisite() ) {
|
||||
update_site_option( 'can_compress_scripts', 0 );
|
||||
} else {
|
||||
update_option( 'can_compress_scripts', 0, 'yes' );
|
||||
update_option( 'can_compress_scripts', 0, 'on' );
|
||||
}
|
||||
} elseif ( 'yes' === $_GET['test'] ) {
|
||||
check_ajax_referer( 'update_can_compress_scripts' );
|
||||
@ -239,7 +239,7 @@ function wp_ajax_wp_compression_test() {
|
||||
if ( is_multisite() ) {
|
||||
update_site_option( 'can_compress_scripts', 1 );
|
||||
} else {
|
||||
update_option( 'can_compress_scripts', 1, 'yes' );
|
||||
update_option( 'can_compress_scripts', 1, 'on' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1016,7 +1016,7 @@ class WP_Upgrader {
|
||||
$lock_option = $lock_name . '.lock';
|
||||
|
||||
// Try to lock.
|
||||
$lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'no') /* LOCK */", $lock_option, time() ) );
|
||||
$lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'off') /* LOCK */", $lock_option, time() ) );
|
||||
|
||||
if ( ! $lock_result ) {
|
||||
$lock_result = get_option( $lock_option );
|
||||
|
@ -594,9 +594,9 @@ function populate_options( array $options = array() ) {
|
||||
}
|
||||
|
||||
if ( in_array( $option, $fat_options, true ) ) {
|
||||
$autoload = 'no';
|
||||
$autoload = 'off';
|
||||
} else {
|
||||
$autoload = 'yes';
|
||||
$autoload = 'on';
|
||||
}
|
||||
|
||||
if ( ! empty( $insert ) ) {
|
||||
|
@ -1412,10 +1412,10 @@ function set_transient( $transient, $value, $expiration = 0 ) {
|
||||
$transient_option = '_transient_' . $transient;
|
||||
|
||||
if ( false === get_option( $transient_option ) ) {
|
||||
$autoload = 'yes';
|
||||
$autoload = 'on';
|
||||
if ( $expiration ) {
|
||||
$autoload = 'no';
|
||||
add_option( $transient_timeout, time() + $expiration, '', 'no' );
|
||||
$autoload = 'off';
|
||||
add_option( $transient_timeout, time() + $expiration, '', 'off' );
|
||||
}
|
||||
$result = add_option( $transient_option, $value, '', $autoload );
|
||||
} else {
|
||||
@ -1428,8 +1428,8 @@ function set_transient( $transient, $value, $expiration = 0 ) {
|
||||
if ( $expiration ) {
|
||||
if ( false === get_option( $transient_timeout ) ) {
|
||||
delete_option( $transient_option );
|
||||
add_option( $transient_timeout, time() + $expiration, '', 'no' );
|
||||
$result = add_option( $transient_option, $value, '', 'no' );
|
||||
add_option( $transient_timeout, time() + $expiration, '', 'off' );
|
||||
$result = add_option( $transient_option, $value, '', 'off' );
|
||||
$update = false;
|
||||
} else {
|
||||
update_option( $transient_timeout, time() + $expiration );
|
||||
@ -2017,7 +2017,7 @@ function add_network_option( $network_id, $option, $value ) {
|
||||
$notoptions_key = "$network_id:notoptions";
|
||||
|
||||
if ( ! is_multisite() ) {
|
||||
$result = add_option( $option, $value, '', 'no' );
|
||||
$result = add_option( $option, $value, '', 'off' );
|
||||
} else {
|
||||
$cache_key = "$network_id:$option";
|
||||
|
||||
@ -2263,7 +2263,7 @@ function update_network_option( $network_id, $option, $value ) {
|
||||
}
|
||||
|
||||
if ( ! is_multisite() ) {
|
||||
$result = update_option( $option, $value, 'no' );
|
||||
$result = update_option( $option, $value, 'off' );
|
||||
} else {
|
||||
$value = sanitize_option( $option, $value );
|
||||
|
||||
|
@ -1012,7 +1012,7 @@ function _wp_upgrade_revisions_of_post( $post, $revisions ) {
|
||||
// Add post option exclusively.
|
||||
$lock = "revision-upgrade-{$post->ID}";
|
||||
$now = time();
|
||||
$result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, 'no') /* LOCK */", $lock, $now ) );
|
||||
$result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, 'off') /* LOCK */", $lock, $now ) );
|
||||
|
||||
if ( ! $result ) {
|
||||
// If we couldn't get a lock, see how old the previous lock is.
|
||||
|
@ -4365,7 +4365,7 @@ function _wp_batch_split_terms() {
|
||||
$lock_name = 'term_split.lock';
|
||||
|
||||
// Try to lock.
|
||||
$lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'no') /* LOCK */", $lock_name, time() ) );
|
||||
$lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'off') /* LOCK */", $lock_name, time() ) );
|
||||
|
||||
if ( ! $lock_result ) {
|
||||
$lock_result = get_option( $lock_name );
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.6-alpha-58104';
|
||||
$wp_version = '6.6-alpha-58105';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user