diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 2849d43f92..49279a9926 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -678,8 +678,29 @@ function wp_admin_bar_appearance_menu( $wp_admin_bar ) { add_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' ); } - if ( current_theme_supports( 'widgets' ) ) - $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) ); + if ( current_theme_supports( 'widgets' ) ) { + $wp_admin_bar->add_menu( array( + 'parent' => 'appearance', + 'id' => 'widgets', + 'title' => __( 'Widgets' ), + 'href' => admin_url( 'widgets.php' ), + 'meta' => array( + 'class' => 'hide-if-customize', + ), + ) ); + + if ( current_user_can( 'customize' ) ) { + $wp_admin_bar->add_menu( array( + 'parent' => 'appearance', + 'id' => 'customize-widgets', + 'title' => __( 'Widgets' ), + 'href' => add_query_arg( urlencode( 'autofocus[panel]' ), 'widgets', $customize_url ), // urlencode() needed due to #16859 + 'meta' => array( + 'class' => 'hide-if-no-customize', + ), + ) ); + } + } if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __('Menus'), 'href' => admin_url('nav-menus.php') ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index ef7aff37fb..f419797047 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31175'; +$wp_version = '4.2-alpha-31176'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.