WordPress.org

Make WordPress Core

Ticket #27538: 27538.2.patch

File 27538.2.patch, 1.5 KB (added by ocean90, 6 years ago)

wp_suspend_cache_addition()

  • src/wp-includes/class-wp-customize-widgets.php

     
    10831083                // Invoke the widget update callback.
    10841084                foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
    10851085                        if ( $name === $parsed_id['id_base'] && is_callable( $control['callback'] ) ) {
     1086                                $_suspend_cache = wp_suspend_cache_addition();
     1087                                wp_suspend_cache_addition( true );
    10861088                                ob_start();
    10871089                                call_user_func_array( $control['callback'], $control['params'] );
    10881090                                ob_end_clean();
     1091                                wp_suspend_cache_addition( $_suspend_cache );
    10891092                                break;
    10901093                        }
    10911094                }
  • src/wp-includes/option.php

     
    626626 * @return bool False if value was not set and true if value was set.
    627627 */
    628628function set_transient( $transient, $value, $expiration = 0 ) {
     629        if ( wp_suspend_cache_addition() )
     630                return false;
    629631
    630632        /**
    631633         * Filter a specific transient before its value is set.
     
    13661368 * @return bool False if value was not set and true if value was set.
    13671369 */
    13681370function set_site_transient( $transient, $value, $expiration = 0 ) {
     1371        if ( wp_suspend_cache_addition() )
     1372                return false;
    13691373
    13701374        /**
    13711375         * Filter the value of a specific site transient before it is set.