Created
March 16, 2012 13:02
-
-
Save deckerweb/2049993 to your computer and use it in GitHub Desktop.
BuddyPress Toolbar plugin - only display for admins / super admins -- add to functions.php file of theme/child theme:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_before_admin_bar_render', 'ddw_bptb_admin_only' ); | |
/** | |
* BuddyPress Toolbar for Admins only | |
* | |
* NOTE: Should work fine for plugin versions 1.0 and 1.1 | |
* | |
* @author David Decker - DECKERWEB | |
* @link http://genesisthemes.de/en/ | |
* @link http://twitter.com/deckerweb | |
*/ | |
function ddw_bptb_admin_only() { | |
global $wp_admin_bar; | |
if ( !is_super_admin() || !current_user_can( 'administrator' ) ) { | |
$wp_admin_bar->remove_menu( 'ddw-buddypress-admin-bar' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment