Ticket #28605: 28605.diff
| File 28605.diff, 9.1 KB (added by , 11 years ago) |
|---|
-
src/wp-admin/customize.php
diff --git src/wp-admin/customize.php src/wp-admin/customize.php index 1faf371..46ec67b 100644
define( 'IFRAME_REQUEST', true ); 12 12 /** Load WordPress Administration Bootstrap */ 13 13 require_once( dirname( __FILE__ ) . '/admin.php' ); 14 14 15 if ( ! current_user_can( ' edit_theme_options' ) )15 if ( ! current_user_can( 'customize' ) ) { 16 16 wp_die( __( 'Cheatin’ uh?' ) ); 17 } 17 18 18 19 wp_reset_vars( array( 'url', 'return' ) ); 19 20 $url = urldecode( $url ); -
src/wp-admin/includes/class-wp-upgrader-skins.php
diff --git src/wp-admin/includes/class-wp-upgrader-skins.php src/wp-admin/includes/class-wp-upgrader-skins.php index c5d1d3f..cd5c68b 100644
class Theme_Upgrader_Skin extends WP_Upgrader_Skin { 594 594 $activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet ); 595 595 596 596 if ( get_stylesheet() == $stylesheet ) { 597 if ( current_user_can( ' edit_theme_options' ) )597 if ( current_user_can( 'customize' ) ) 598 598 $update_actions['preview'] = '<a href="' . wp_customize_url( $stylesheet ) . '" class="hide-if-no-customize load-customize" title="' . esc_attr( sprintf( __('Customize “%s”'), $name ) ) . '">' . __('Customize') . '</a>'; 599 599 } elseif ( current_user_can( 'switch_themes' ) ) { 600 600 $update_actions['preview'] = '<a href="' . esc_url( $preview_link ) . '" class="hide-if-customize" title="' . esc_attr( sprintf( __('Preview “%s”'), $name ) ) . '">' . __('Preview') . '</a>'; -
src/wp-admin/includes/schema.php
diff --git src/wp-admin/includes/schema.php src/wp-admin/includes/schema.php index b88a7ab..495e1b6 100644
function populate_roles() { 584 584 populate_roles_270(); 585 585 populate_roles_280(); 586 586 populate_roles_300(); 587 populate_roles_400(); 587 588 } 588 589 589 590 /** … … function populate_roles_160() { 633 634 $role->add_cap('publish_posts'); 634 635 $role->add_cap('edit_pages'); 635 636 $role->add_cap('read'); 637 $role->add_cap('customize'); 636 638 $role->add_cap('level_10'); 637 639 $role->add_cap('level_9'); 638 640 $role->add_cap('level_8'); … … function populate_roles_300() { 830 832 } 831 833 832 834 /** 835 * Create and modify WordPress roles for WordPress 4.0. 836 * 837 * @since 4.0.0 838 */ 839 function populate_roles_400() { 840 $role = get_role( 'administrator' ); 841 842 if ( ! empty( $role ) ) { 843 $role->add_cap( 'customize' ); 844 } 845 } 846 847 /** 833 848 * Install Network. 834 849 * 835 850 * @since 3.0.0 -
src/wp-admin/includes/upgrade.php
diff --git src/wp-admin/includes/upgrade.php src/wp-admin/includes/upgrade.php index 9e9441e..e105eee 100644
function upgrade_all() { 435 435 if ( $wp_current_db_version < 26691 ) 436 436 upgrade_380(); 437 437 438 if ( $wp_current_db_version < 27917 ) 439 upgrade_400(); 440 438 441 maybe_disable_link_manager(); 439 442 440 443 maybe_disable_automattic_widgets(); … … function upgrade_380() { 1296 1299 deactivate_plugins( array( 'mp6/mp6.php' ), true ); 1297 1300 } 1298 1301 } 1302 1303 /** 1304 * Execute changes made in WordPress 4.0.0. 1305 * 1306 * @since 4.0.0 1307 */ 1308 function upgrade_400() { 1309 global $wp_current_db_version; 1310 if ( $wp_current_db_version < 27917 ) { 1311 populate_roles_400(); 1312 } 1313 } 1314 1299 1315 /** 1300 1316 * Execute network level changes 1301 1317 * -
src/wp-admin/menu.php
diff --git src/wp-admin/menu.php src/wp-admin/menu.php index 4008a09..ca76360 100644
$appearance_cap = current_user_can( 'switch_themes') ? 'switch_themes' : 'edit_t 146 146 147 147 $menu[60] = array( __('Appearance'), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' ); 148 148 $submenu['themes.php'][5] = array( __( 'Themes' ), $appearance_cap, 'themes.php' ); 149 $submenu['themes.php'][6] = array( __( 'Customize' ), ' edit_theme_options', 'customize.php', 'hide-if-no-customize' );149 $submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', 'customize.php', 'hide-if-no-customize' ); 150 150 if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) 151 151 $submenu['themes.php'][10] = array(__( 'Menus' ), 'edit_theme_options', 'nav-menus.php'); 152 152 -
src/wp-admin/themes.php
diff --git src/wp-admin/themes.php src/wp-admin/themes.php index 0117c0d..55057b9 100644
foreach ( $themes as $theme ) : 212 212 <div class="theme-actions"> 213 213 214 214 <?php if ( $theme['active'] ) { ?> 215 <?php if ( $theme['actions']['customize'] ) { ?>215 <?php if ( $theme['actions']['customize'] && current_user_can( 'customize' ) ) { ?> 216 216 <a class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Customize' ); ?></a> 217 217 <?php } ?> 218 218 <?php } else { ?> 219 219 <a class="button button-primary activate" href="<?php echo $theme['actions']['activate']; ?>"><?php _e( 'Activate' ); ?></a> 220 <a class="button button-secondary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a> 221 <a class="button button-secondary hide-if-customize" href="<?php echo $theme['actions']['preview']; ?>"><?php _e( 'Preview' ); ?></a> 220 <?php if ( current_user_can( 'customize' ) ) { ?> 221 <a class="button button-secondary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a> 222 <a class="button button-secondary hide-if-customize" href="<?php echo $theme['actions']['preview']; ?>"><?php _e( 'Preview' ); ?></a> 223 <?php } ?> 222 224 <?php } ?> 223 225 224 226 </div> -
src/wp-includes/admin-bar.php
diff --git src/wp-includes/admin-bar.php src/wp-includes/admin-bar.php index 2a5c3b1..f4ea1c5 100644
function wp_admin_bar_appearance_menu( $wp_admin_bar ) { 645 645 if ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) ) 646 646 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'themes', 'title' => __('Themes'), 'href' => admin_url('themes.php') ) ); 647 647 648 if ( ! current_user_can( 'edit_theme_options' ) ) 649 return; 650 651 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 652 $wp_admin_bar->add_menu( array( 653 'parent' => 'appearance', 654 'id' => 'customize', 655 'title' => __('Customize'), 656 'href' => add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() ), 657 'meta' => array( 658 'class' => 'hide-if-no-customize', 659 ), 660 ) ); 661 add_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' ); 648 if ( current_user_can( 'customize' ) ) { 649 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 650 $wp_admin_bar->add_menu( array( 651 'parent' => 'appearance', 652 'id' => 'customize', 653 'title' => __( 'Customize' ), 654 'href' => add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() ), 655 'meta' => array( 656 'class' => 'hide-if-no-customize', 657 ), 658 ) ); 659 add_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' ); 660 } 662 661 663 if ( current_theme_supports( 'widgets' ) ) 664 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) ); 662 if ( current_user_can( 'edit_theme_options' ) ) { 663 if ( current_theme_supports( 'widgets' ) ) { 664 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __( 'Widgets' ), 'href' => admin_url( 'widgets.php' ) ) ); 665 } 665 666 666 if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) 667 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __('Menus'), 'href' => admin_url('nav-menus.php') ) ); 667 if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) { 668 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __( 'Menus' ), 'href' => admin_url( 'nav-menus.php' ) ) ); 669 } 668 670 669 if ( current_theme_supports( 'custom-background' ) ) 670 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'background', 'title' => __('Background'), 'href' => admin_url('themes.php?page=custom-background') ) ); 671 if ( current_theme_supports( 'custom-background' ) ) { 672 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'background', 'title' => __( 'Background' ), 'href' => admin_url( 'themes.php?page=custom-background' ) ) ); 673 } 671 674 672 if ( current_theme_supports( 'custom-header' ) ) 673 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __('Header'), 'href' => admin_url('themes.php?page=custom-header') ) ); 675 if ( current_theme_supports( 'custom-header' ) ) { 676 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __( 'Header' ), 'href' => admin_url( 'themes.php?page=custom-header' ) ) ); 677 } 678 } 674 679 } 675 680 676 681 /** -
src/wp-includes/version.php
diff --git src/wp-includes/version.php src/wp-includes/version.php index 9ed4297..7df42a4 100644
$wp_version = '4.0-alpha-28611-src'; 11 11 * 12 12 * @global int $wp_db_version 13 13 */ 14 $wp_db_version = 2791 6;14 $wp_db_version = 27917; 15 15 16 16 /** 17 17 * Holds the TinyMCE version