Changeset 31533 for trunk/src/wp-includes/admin-bar.php
- Timestamp:
- 02/24/2015 08:30:22 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/admin-bar.php
r31456 r31533 651 651 $wp_admin_bar->add_group( array( 'parent' => 'site-name', 'id' => 'appearance' ) ); 652 652 653 if ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) )654 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'themes', 'title' => __('Themes'), 'href' => admin_url('themes.php') ) );655 656 if ( ! current_user_can( 'edit_theme_options' ) )657 return;658 659 653 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 660 654 $customize_url = add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() ); 655 656 if ( current_user_can( 'switch_themes' ) ) { 657 $wp_admin_bar->add_menu( array( 658 'parent' => 'appearance', 659 'id' => 'themes', 660 'title' => __( 'Themes' ), 661 'href' => admin_url( 'themes.php' ), 662 'meta' => array( 663 'class' => 'hide-if-customize', 664 ), 665 ) ); 666 667 if ( current_user_can( 'customize' ) ) { 668 $wp_admin_bar->add_menu( array( 669 'parent' => 'appearance', 670 'id' => 'customize-themes', 671 'title' => __( 'Themes' ), 672 'href' => add_query_arg( urlencode( 'autofocus[section]' ), 'themes', $customize_url ), // urlencode() needed due to #16859 673 'meta' => array( 674 'class' => 'hide-if-no-customize', 675 ), 676 ) ); 677 } 678 } 679 661 680 if ( current_user_can( 'customize' ) ) { 662 681 $wp_admin_bar->add_menu( array( … … 670 689 ) ); 671 690 add_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' ); 691 } 692 693 if ( ! current_user_can( 'edit_theme_options' ) ) { 694 return; 672 695 } 673 696
Note: See TracChangeset
for help on using the changeset viewer.