diff --git a/src/wp-admin/admin-header.php b/src/wp-admin/admin-header.php index 10349750eb..c9d49d2b1b 100644 --- a/src/wp-admin/admin-header.php +++ b/src/wp-admin/admin-header.php @@ -177,8 +177,9 @@ $admin_body_class .= ' no-customize-support no-svg';
' . __( 'Tap or hover on any theme then click the Live Preview button to see a live preview of that theme and change theme options in a separate, full-screen view. You can also find a Live Preview button at the bottom of the theme details screen. Any installed theme can be previewed and customized in this way.' ) . '
'. '' . __( 'The theme being previewed is fully interactive — navigate to different pages to see how the theme handles posts, archives, and other page templates. The settings may differ depending on what theme features the theme being previewed supports. To accept the new settings and activate the theme all in one step, click the Save & Activate button above the menu.' ) . '
' . @@ -78,7 +78,7 @@ if ( current_user_can( 'edit_theme_options' ) ) { 'title' => __( 'Previewing and Customizing' ), 'content' => $help_customize ) ); -} // edit_theme_options +} // edit_theme_options && customize get_current_screen()->set_help_sidebar( '' . __( 'For more information:' ) . '
' . @@ -212,13 +212,15 @@ foreach ( $themes as $theme ) : diff --git a/src/wp-includes/admin-bar.php b/src/wp-includes/admin-bar.php index 9e4c115a31..0acefd07dc 100644 --- a/src/wp-includes/admin-bar.php +++ b/src/wp-includes/admin-bar.php @@ -660,17 +660,19 @@ function wp_admin_bar_appearance_menu( $wp_admin_bar ) { if ( ! current_user_can( 'edit_theme_options' ) ) return; - $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; - $wp_admin_bar->add_menu( array( - 'parent' => 'appearance', - 'id' => 'customize', - 'title' => __('Customize'), - 'href' => add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() ), - 'meta' => array( - 'class' => 'hide-if-no-customize', - ), - ) ); - add_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' ); + if ( current_user_can( 'customize' ) ) { + $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; + $wp_admin_bar->add_menu( array( + 'parent' => 'appearance', + 'id' => 'customize', + 'title' => __('Customize'), + 'href' => add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() ), + 'meta' => array( + 'class' => 'hide-if-no-customize', + ), + ) ); + 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') ) ); diff --git a/src/wp-includes/capabilities.php b/src/wp-includes/capabilities.php index ae885f6fa0..45be4b5517 100644 --- a/src/wp-includes/capabilities.php +++ b/src/wp-includes/capabilities.php @@ -1306,6 +1306,9 @@ function map_meta_cap( $cap, $user_id ) { else $caps[] = 'do_not_allow'; break; + case 'customize' : + $caps[] = 'edit_theme_options'; + break; default: // Handle meta capabilities for custom post types. $post_type_meta_caps = _post_type_meta_capabilities(); diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 5f01a6916f..5e2ba5dd89 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -157,8 +157,9 @@ final class WP_Customize_Manager { show_admin_bar( false ); - if ( ! current_user_can( 'edit_theme_options' ) ) + if ( ! current_user_can( 'customize' ) ) { $this->wp_die( -1 ); + } $this->original_stylesheet = get_stylesheet();