Customize: Always enqueue customize-preview stylesheet in the customizer preview to style selective refresh and visual edit shortcuts.

Enqueues the style along with the `customize-preview` script in the manager instead of via the `widgets` and `nav_menus` components, ensuring that the stylesheet is loaded for users who cannot manage widgets or nav menus.

Props dlh.
See #27403.
Fixes #39498.


git-svn-id: https://develop.svn.wordpress.org/trunk@39951 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter 2017-01-26 03:46:52 +00:00
parent f6938b23b1
commit 8f4e0b7ed8
3 changed files with 1 additions and 2 deletions

View File

@ -1577,6 +1577,7 @@ final class WP_Customize_Manager {
add_filter( 'wp_redirect', array( $this, 'add_state_query_params' ) );
wp_enqueue_script( 'customize-preview' );
wp_enqueue_style( 'customize-preview' );
add_action( 'wp_head', array( $this, 'customize_preview_loading_style' ) );
add_action( 'wp_head', array( $this, 'remove_frameless_preview_messenger_channel' ) );
add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );

View File

@ -1327,7 +1327,6 @@ final class WP_Customize_Nav_Menus {
*/
public function customize_preview_enqueue_deps() {
wp_enqueue_script( 'customize-preview-nav-menus' ); // Note that we have overridden this.
wp_enqueue_style( 'customize-preview' );
}
/**

View File

@ -1086,7 +1086,6 @@ final class WP_Customize_Widgets {
*/
public function customize_preview_enqueue() {
wp_enqueue_script( 'customize-preview-widgets' );
wp_enqueue_style( 'customize-preview' );
}
/**