mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Customizer: Add meta capability customize which is mapped to edit_theme_options.
You can now allow users to access the Customizer, say for any user who can `edit_posts`, via `map_meta_cap` or `user_has_cap` filter. See ticket for examples. props westonruter, nacin. fixes #28605. git-svn-id: https://develop.svn.wordpress.org/trunk@29170 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -660,17 +660,19 @@ function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
|
||||
if ( ! current_user_can( 'edit_theme_options' ) )
|
||||
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' ) )
|
||||
$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) );
|
||||
|
||||
Reference in New Issue
Block a user