Index: /trunk/src/wp-admin/admin-header.php =================================================================== --- /trunk/src/wp-admin/admin-header.php (revision 29169) +++ /trunk/src/wp-admin/admin-header.php (revision 29170) @@ -178,6 +178,7 @@ Index: /trunk/src/wp-admin/customize.php =================================================================== --- /trunk/src/wp-admin/customize.php (revision 29169) +++ /trunk/src/wp-admin/customize.php (revision 29170) @@ -13,5 +13,5 @@ require_once( dirname( __FILE__ ) . '/admin.php' ); -if ( ! current_user_can( 'edit_theme_options' ) ) { +if ( ! current_user_can( 'customize' ) ) { wp_die( __( 'Cheatin’ uh?' ) ); } @@ -25,5 +25,11 @@ } if ( ! $return ) { - $return = $url; + if ( $url ) { + $return = $url; + } elseif ( current_user_can( 'edit_theme_options' ) || current_user_can( 'switch_themes' ) ) { + $return = admin_url( 'themes.php' ); + } else { + $return = admin_url(); + } } @@ -113,5 +119,5 @@ ?> - + Index: /trunk/src/wp-admin/includes/class-wp-themes-list-table.php =================================================================== --- /trunk/src/wp-admin/includes/class-wp-themes-list-table.php (revision 29169) +++ /trunk/src/wp-admin/includes/class-wp-themes-list-table.php (revision 29170) @@ -150,7 +150,8 @@ . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '">' . __( 'Preview' ) . ''; - if ( current_user_can( 'edit_theme_options' ) ) + if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { $actions['preview'] .= ' '; + } if ( ! is_multisite() && current_user_can( 'delete_themes' ) ) Index: /trunk/src/wp-admin/includes/class-wp-upgrader-skins.php =================================================================== --- /trunk/src/wp-admin/includes/class-wp-upgrader-skins.php (revision 29169) +++ /trunk/src/wp-admin/includes/class-wp-upgrader-skins.php (revision 29170) @@ -523,5 +523,7 @@ $install_actions = array(); $install_actions['preview'] = ' '; - $install_actions['preview'] .= ' '; + if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { + $install_actions['preview'] .= ' '; + } $install_actions['activate'] = '' . __('Activate') . ''; @@ -595,9 +597,12 @@ if ( get_stylesheet() == $stylesheet ) { - if ( current_user_can( 'edit_theme_options' ) ) + if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { $update_actions['preview'] = ' '; + } } elseif ( current_user_can( 'switch_themes' ) ) { $update_actions['preview'] = ' '; - $update_actions['preview'] .= ' '; + if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { + $update_actions['preview'] .= ' '; + } $update_actions['activate'] = '' . __('Activate') . ''; } Index: /trunk/src/wp-admin/includes/dashboard.php =================================================================== --- /trunk/src/wp-admin/includes/dashboard.php (revision 29169) +++ /trunk/src/wp-admin/includes/dashboard.php (revision 29170) @@ -1280,6 +1280,8 @@
' . __( '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.' ) . '
'. @@ -79,5 +79,5 @@ 'content' => $help_customize ) ); -} // edit_theme_options +} // edit_theme_options && customize get_current_screen()->set_help_sidebar( @@ -213,11 +213,13 @@ - + - - + + + + Index: /trunk/src/wp-includes/admin-bar.php =================================================================== --- /trunk/src/wp-includes/admin-bar.php (revision 29169) +++ /trunk/src/wp-includes/admin-bar.php (revision 29170) @@ -661,15 +661,17 @@ 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' ) ) Index: /trunk/src/wp-includes/capabilities.php =================================================================== --- /trunk/src/wp-includes/capabilities.php (revision 29169) +++ /trunk/src/wp-includes/capabilities.php (revision 29170) @@ -1307,4 +1307,7 @@ $caps[] = 'do_not_allow'; break; + case 'customize' : + $caps[] = 'edit_theme_options'; + break; default: // Handle meta capabilities for custom post types. Index: /trunk/src/wp-includes/class-wp-customize-manager.php =================================================================== --- /trunk/src/wp-includes/class-wp-customize-manager.php (revision 29169) +++ /trunk/src/wp-includes/class-wp-customize-manager.php (revision 29170) @@ -158,6 +158,7 @@ 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();