Permalink
Browse files

Merge pull request #27 from mindctrl/master

Only show "Theme Options" in admin bar to users who have edit_theme_options permission
  • Loading branch information...
2 parents 70565e7 + 797ad2c commit 9f139293778b01ccc4f9d53f1491622283a51d4c @devinsays devinsays committed Mar 24, 2012
Showing with 14 additions and 12 deletions.
  1. +14 −12 admin/options-framework.php
@@ -354,22 +354,24 @@ function of_get_default_values() {
return $output;
}
-/**
- * Add Theme Options menu item to Admin Bar.
- */
+if ( current_user_can('edit_theme_options') ) {
+ /**
+ * Add Theme Options menu item to Admin Bar.
+ */
-add_action( 'wp_before_admin_bar_render', 'optionsframework_adminbar' );
+ add_action( 'wp_before_admin_bar_render', 'optionsframework_adminbar' );
-function optionsframework_adminbar() {
+ function optionsframework_adminbar() {
- global $wp_admin_bar;
+ global $wp_admin_bar;
- $wp_admin_bar->add_menu( array(
- 'parent' => 'appearance',
- 'id' => 'of_theme_options',
- 'title' => __( 'Theme Options' ),
- 'href' => admin_url( 'themes.php?page=options-framework' )
- ));
+ $wp_admin_bar->add_menu( array(
+ 'parent' => 'appearance',
+ 'id' => 'of_theme_options',
+ 'title' => __( 'Theme Options' ),
+ 'href' => admin_url( 'themes.php?page=options-framework' )
+ ));
+ }
}
if ( ! function_exists( 'of_get_option' ) ) {

0 comments on commit 9f13929

Please sign in to comment.