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. git-svn-id: http://core.svn.wordpress.org/trunk@20924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3f5a35aa11
commit
ea95fd213b
|
@ -37,6 +37,14 @@ final class WP_Customize_Manager {
|
||||||
// Run wp_redirect_status late to make sure we override the status last.
|
// Run wp_redirect_status late to make sure we override the status last.
|
||||||
add_action( 'wp_redirect_status', array( $this, 'wp_redirect_status' ), 1000 );
|
add_action( 'wp_redirect_status', array( $this, 'wp_redirect_status' ), 1000 );
|
||||||
|
|
||||||
|
// Do not spawn cron (especially the alternate cron) while running the customizer.
|
||||||
|
remove_action( 'init', 'wp_cron' );
|
||||||
|
|
||||||
|
// Do not run update checks when rendering the controls.
|
||||||
|
remove_action( 'admin_init', '_maybe_update_core' );
|
||||||
|
remove_action( 'admin_init', '_maybe_update_plugins' );
|
||||||
|
remove_action( 'admin_init', '_maybe_update_themes' );
|
||||||
|
|
||||||
add_action( 'wp_ajax_customize_save', array( $this, 'save' ) );
|
add_action( 'wp_ajax_customize_save', array( $this, 'save' ) );
|
||||||
|
|
||||||
add_action( 'customize_register', array( $this, 'register_controls' ) );
|
add_action( 'customize_register', array( $this, 'register_controls' ) );
|
||||||
|
|
Loading…
Reference in New Issue