Ticket #31245: 31245.5.fabian-race-fix.diff
File 31245.5.fabian-race-fix.diff, 1.9 KB (added by , 5 years ago) |
---|
-
src/wp-includes/option.php
189 189 * Loads and caches all autoloaded options, if available or all options. 190 190 * 191 191 * @since 2.2.0 192 * @since 5.4.0 The `$force_cache` parameter was added. 192 193 * 193 194 * @global wpdb $wpdb WordPress database abstraction object. 194 195 * 196 * @param bool $force_cache Optional. Whether to force an update of the local cache 197 * from the persistent cache. Default false. 195 198 * @return array List of all options. 196 199 */ 197 function wp_load_alloptions( ) {200 function wp_load_alloptions( $force_cache = false ) { 198 201 global $wpdb; 199 202 200 203 if ( ! wp_installing() || ! is_multisite() ) { 201 $alloptions = wp_cache_get( 'alloptions', 'options' );204 $alloptions = wp_cache_get( 'alloptions', 'options', $force_cache ); 202 205 } else { 203 206 $alloptions = false; 204 207 } … … 397 400 } 398 401 399 402 if ( ! wp_installing() ) { 400 $alloptions = wp_load_alloptions( );403 $alloptions = wp_load_alloptions( true ); 401 404 if ( isset( $alloptions[ $option ] ) ) { 402 405 $alloptions[ $option ] = $serialized_value; 403 406 wp_cache_set( 'alloptions', $alloptions, 'options' ); … … 505 508 506 509 if ( ! wp_installing() ) { 507 510 if ( 'yes' == $autoload ) { 508 $alloptions = wp_load_alloptions( );511 $alloptions = wp_load_alloptions( true ); 509 512 $alloptions[ $option ] = $serialized_value; 510 513 wp_cache_set( 'alloptions', $alloptions, 'options' ); 511 514 } else { … … 583 586 $result = $wpdb->delete( $wpdb->options, array( 'option_name' => $option ) ); 584 587 if ( ! wp_installing() ) { 585 588 if ( 'yes' == $row->autoload ) { 586 $alloptions = wp_load_alloptions( );589 $alloptions = wp_load_alloptions( true ); 587 590 if ( is_array( $alloptions ) && isset( $alloptions[ $option ] ) ) { 588 591 unset( $alloptions[ $option ] ); 589 592 wp_cache_set( 'alloptions', $alloptions, 'options' );