| 686 | | if ( current_theme_supports( 'widgets' ) ) |
| 687 | | $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) ); |
| | 686 | if ( current_theme_supports( 'widgets' ) ) { |
| | 687 | $wp_admin_bar->add_menu( array( |
| | 688 | 'parent' => 'appearance', |
| | 689 | 'id' => 'widgets', |
| | 690 | 'title' => __( 'Widgets' ), |
| | 691 | 'href' => admin_url( 'widgets.php' ), |
| | 692 | 'meta' => array( |
| | 693 | 'class' => 'hide-if-customize', |
| | 694 | ), |
| | 695 | ) ); |
| | 697 | if ( current_user_can( 'customize' ) ) { |
| | 698 | $wp_admin_bar->add_menu( array( |
| | 699 | 'parent' => 'appearance', |
| | 700 | 'id' => 'customize-widgets', |
| | 701 | 'title' => __( 'Widgets' ), |
| | 702 | 'href' => add_query_arg( urlencode( 'autofocus[panel]' ), 'widgets', $customize_url ), // urlencode() needed due to #16859 |
| | 703 | 'meta' => array( |
| | 704 | 'class' => 'hide-if-no-customize', |
| | 705 | ), |
| | 706 | ) ); |
| | 707 | } |
| | 708 | |
| | 709 | |
| | 710 | } |
| | 711 | |