Make WordPress Core


Ignore:
Timestamp:
05/26/2012 03:52:14 AM (13 years ago)
Author:
nacin
Message:

Do not spawn cron or trigger update checks when running the customizer.

Both can slow down the experience.

The alternate cron will issue a redirect which creates more work for the
customizer, but not exit immediately, which means shutdown will be delayed
(see future changeset from koopersmith in #20507 where we check for a token
printed on shutdown to ensure the response came from the customizer).

The update checks could also cause bad data to be sent. In particular, the
currently active theme would be incorrect.

see #20507.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-customize-manager.php

    r20915 r20924  
    3737        // Run wp_redirect_status late to make sure we override the status last.
    3838        add_action( 'wp_redirect_status', array( $this, 'wp_redirect_status' ), 1000 );
     39
     40        // Do not spawn cron (especially the alternate cron) while running the customizer.
     41        remove_action( 'init', 'wp_cron' );
     42
     43        // Do not run update checks when rendering the controls.
     44        remove_action( 'admin_init', '_maybe_update_core' );
     45        remove_action( 'admin_init', '_maybe_update_plugins' );
     46        remove_action( 'admin_init', '_maybe_update_themes' );
    3947
    4048        add_action( 'wp_ajax_customize_save', array( $this, 'save' ) );
Note: See TracChangeset for help on using the changeset viewer.