Make WordPress Core


Ignore:
Timestamp:
01/13/2015 07:44:57 AM (10 years ago)
Author:
SergeyBiryukov
Message:

Customizer: Use deep-link for Widgets in toolbar on front-end.

props caseypatrickdriscoll.
fixes #30971.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/admin-bar.php

    r31168 r31176  
    679679    }
    680680
    681     if ( current_theme_supports( 'widgets' )  )
    682         $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) );
     681    if ( current_theme_supports( 'widgets' )  ) {
     682        $wp_admin_bar->add_menu( array(
     683            'parent' => 'appearance',
     684            'id'     => 'widgets',
     685            'title'  => __( 'Widgets' ),
     686            'href'   => admin_url( 'widgets.php' ),
     687            'meta'   => array(
     688                'class' => 'hide-if-customize',
     689            ),
     690        ) );
     691
     692        if ( current_user_can( 'customize' ) ) {
     693            $wp_admin_bar->add_menu( array(
     694                'parent' => 'appearance',
     695                'id'     => 'customize-widgets',
     696                'title'  => __( 'Widgets' ),
     697                'href'   => add_query_arg( urlencode( 'autofocus[panel]' ), 'widgets', $customize_url ), // urlencode() needed due to #16859
     698                'meta'   => array(
     699                    'class' => 'hide-if-no-customize',
     700                ),
     701            ) );
     702        }
     703    }
    683704
    684705    if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
Note: See TracChangeset for help on using the changeset viewer.