Skip to content

Instantly share code, notes, and snippets.

@deckerweb
Created March 16, 2012 13:02
Show Gist options
  • Save deckerweb/2049993 to your computer and use it in GitHub Desktop.
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:
<?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