From de7de0a0d648f1f5ad36510b1f14aef79af0ce07 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 21 Feb 2017 06:54:35 +0000 Subject: [PATCH] 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, westonruter. Merges [39951] to the 4.7 branch. See #27403. Fixes #39498. Built from https://develop.svn.wordpress.org/branches/4.7@40095 git-svn-id: http://core.svn.wordpress.org/branches/4.7@40032 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-customize-manager.php | 1 + wp-includes/class-wp-customize-nav-menus.php | 1 - wp-includes/class-wp-customize-widgets.php | 1 - wp-includes/version.php | 2 +- 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index f80708a23f..7f3e5a5b2d 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -1571,6 +1571,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 ); diff --git a/wp-includes/class-wp-customize-nav-menus.php b/wp-includes/class-wp-customize-nav-menus.php index 49c92198fa..e3e9233ade 100644 --- a/wp-includes/class-wp-customize-nav-menus.php +++ b/wp-includes/class-wp-customize-nav-menus.php @@ -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' ); } /** diff --git a/wp-includes/class-wp-customize-widgets.php b/wp-includes/class-wp-customize-widgets.php index 4be73e4d81..0cd2359d56 100644 --- a/wp-includes/class-wp-customize-widgets.php +++ b/wp-includes/class-wp-customize-widgets.php @@ -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' ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index e3d53eee18..1875790e7c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7.3-alpha-40094'; +$wp_version = '4.7.3-alpha-40095'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.