WordPress.org

Ready to get started?Download WordPress

Plugin Directory

BuddyPress Toolbar

This plugin adds useful admin links and resources for BuddyPress 1.5+/1.6+/1.7+ to the WordPress Toolbar / Admin Bar.

Does this plugin work with the latest WP version and also older versions?

Indeed, it does! And it does only run with WordPress 3.4 or higher! Therefore, you can only run it with BuddyPress 1.6+ (or former branch 1.5 and WP 3.3+ but NOT lower than this! Otherwise it will break your site. So, you've been warned.)

Is this plugin Multisite compatible?

Yes, it is! :) Works really fine in Multisite invironment.

In Multisite, could I "network enable" this plugin?

Yes, you could. -- It fully supports all Multisite aware settings pages, Multisite Blogs and also Multisite admin pages of supported plugins.

How are new resources being added to the admin bar?

Just drop me a note on my Twitter @deckerweb or via my contact page and I'll add the link if it is useful for admins/ webmasters and the BuddyPress community.

How could my plugin/extension or theme options page be added to the admin bar links?

This is possible of course and highly welcomed! Just drop me a note on my Twitter @deckerweb or via my contact page and we sort out the details! Particularly, I need the admin url for the primary options page (like so wp-admin/admin.php?page=foo) - this is relevant for both, plugins and themes. For themes then I also need the correct name defined in the stylesheet (like so Footheme) and the correct folder name (like so footheme-folder) because this would be the template name when using with child themes. (I don't own all the premium stuff myself yet so you're more than welcomed to help me out with these things. Thank you!)

There are still some other plugins for BuddyPress out there why aren't these included by default?

  • Simple answer: The settings of these add-ons have no settings page to link to. So linking/ adding is just not possible.
  • Note: More plugin and theme support will be added from time to time.

Can custom menu items be hooked in via theme or other plugins?

Yes, this is possible since version 1.2 of the plugin! There are 4 action hooks available for hooking custom menu items in -- bptb_custom_main_items for the main section, bptb_custom_extension_items for the exentensions section, bptb_custom_theme_items for the theme section plus bptb_custom_group_items for the resource group section. Here's an example code:

add_action( 'bptb_custom_group_items', 'bptb_custom_additional_group_item' );
/**
 * BuddyPress Toolbar: Custom Resource Group Items
 *
 * @global mixed $wp_admin_bar
 */
function bptb_custom_additional_group_item() {

    global $wp_admin_bar;

    $wp_admin_bar->add_menu( array(
        'parent' => 'ddw-buddypress-bpgroup',
        'id'     => 'your-unique-item-id',
        'title'  => __( 'Custom Menu Item Name', 'your-textdomain' ),
        'href'   => 'http://deckerweb.de/',
        'meta'   => array( 'title' => __( 'Custom Menu Item Name Tooltip', 'your-textdomain' ) )
    ) );
}

Can certain sections be removed?

Yes, this is possible! You can remove the following sections: "Manage Groups" group (all items) / "Extensions" area (all items) / "Theme" (all items!) / "Resources link group" at the bottom (all items) / "German language stuff" (all items) / "Translations" (all items)

To achieve this add one, some or all of the following constants to your theme's/child theme's functions.php file:

/** BuddyPress Toolbar: Remove Manage Content Items */
define( 'BPTB_MANAGE_GROUPS_DISPLAY', FALSE );

/** BuddyPress Toolbar: Remove Extensions Items */
define( 'BPTB_EXTENSIONS_DISPLAY', FALSE );

/** BuddyPress Toolbar: Remove Theme Items */
define( 'BPTB_THEME_DISPLAY', FALSE );

/** BuddyPress Toolbar: Remove Resource Items */
define( 'BPTB_RESOURCES_DISPLAY', FALSE );

/** BuddyPress Toolbar: Remove German Language Items */
define( 'BPTB_DE_DISPLAY', FALSE );

/** BuddyPress Toolbar: Remove Translations Items */
define( 'BPTB_TRANSLATIONS_DISPLAY', FALSE );

Can the the whole toolbar entry be removed, especially for certain users?

Yes, that's also possible! This could be useful if your site has special user roles/capabilities or other settings that are beyond the default WordPress stuff etc. For example: if you want to disable the display of any "BuddyPress Toolbar" items for all user roles of "Editor" please use this code:

/** BuddyPress Toolbar: Remove all items for "Editor" user role */
if ( current_user_can( 'editor' ) ) {
    define( 'BPTB_DISPLAY', FALSE );
}

To hide only from the user with a user ID of "2":

/** BuddyPress Toolbar: Remove all items for user ID 2 */
if ( 2 == get_current_user_id() ) {
    define( 'BPTB_DISPLAY', FALSE );
}

To hide items only in frontend use this code:

/** BuddyPress Toolbar: Remove all items from frontend */
if ( ! is_admin() ) {
    define( 'BPTB_DISPLAY', FALSE );
}

In general, use this constant do hide any "BuddyPress Toolbar" items:

/** BuddyPress Toolbar: Remove all items */
define( 'BPTB_DISPLAY', FALSE );

Can I remove the original Toolbar items for BuddyPress Media plugin?

Yes, this is also possible! Since v1.5.0 - so if you only want that plugin stuff to appear within "BuddyPress Toolbar" just add this constant to your active theme's/ child theme's functions.php file or a functionality plugin:

/** BuddyPress Toolbar: Remove original BuddyPress Media items */
define( 'BPTB_REMOVE_BPMEDIA_TOOLBAR', TRUE );

Available Filters to Customize More Stuff

All filters are listed with the filter name in bold and the below additional info, helper functions (if available) as well as usage examples.

bptb_filter_capability_all

  • Default value: administrator (BuddyPress admin stuff should only be done by admins, right?!)
  • 4 Predefined helper functions:
    • __bptb_role_editor -- returns 'editor' role -- usage:
add_filter( 'bptb_filter_capability_all', '__bptb_role_editor' );
  • __bptb_cap_edit_theme_options -- returns 'edit_theme_options' capability -- usage:
add_filter( 'bptb_filter_capability_all', '__bptb_cap_edit_theme_options' );
  • __bptb_cap_manage_options -- returns 'manage_options' capability -- usage:
add_filter( 'bptb_filter_capability_all', '__bptb_cap_manage_options' );
  • __bptb_cap_install_plugins -- returns 'install_plugins' capability -- usage:
add_filter( 'bptb_filter_capability_all', '__bptb_cap_install_plugins' );
  • Another example:
add_filter( 'bptb_filter_capability_all', 'custom_bptb_capability_all' );
/**
 * BuddyPress Toolbar: Change Main Capability
 */
function custom_bptb_capability_all() {
    return 'activate_plugins';
}

--> Changes the capability to activate_plugins

bptb_filter_main_icon

  • Default value: BuddyPress logo (favicon) with some kind of orange/red touch... :)
  • 11 Predefined helper functions for the 11 included colored icons, returning special colored icon values - the helper function always has this name: __bptb_colornamehere_icon() this results in the following filters ready for usage:
add_filter( 'bptb_filter_main_icon', '__bptb_blue_icon' );

add_filter( 'bptb_filter_main_icon', '__bptb_brown_icon' );

add_filter( 'bptb_filter_main_icon', '__bptb_gray_icon' );

add_filter( 'bptb_filter_main_icon', '__bptb_green_icon' );

add_filter( 'bptb_filter_main_icon', '__bptb_khaki_icon' );

add_filter( 'bptb_filter_main_icon', '__bptb_orange_icon' );

add_filter( 'bptb_filter_main_icon', '__bptb_pink_icon' );

add_filter( 'bptb_filter_main_icon', '__bptb_red_icon' );

add_filter( 'bptb_filter_main_icon', '__bptb_turquoise_icon' );

add_filter( 'bptb_filter_main_icon', '__bptb_yellow_icon' );

add_filter( 'bptb_filter_main_icon', '__bptb_yellowtwo_icon' );

add_filter( 'bptb_filter_main_icon', '__bptb_theme_images_icon' );

--> Where the last helper function returns the icon file (icon-bptb.png) found in your current theme's/child theme's /images/ subfolder

  • Example for using with current child theme:
add_filter( 'bptb_filter_main_icon', 'custom_bptb_main_icon' );
/**
 * BuddyPress Toolbar: Change Main Icon
 */
function custom_bptb_main_icon() {
    return get_stylesheet_directory_uri() . '/images/custom-icon.png';
}

--> Uses a custom image from your active child theme's /images/ folder

--> Recommended dimensions are 16px x 16px

bptb_filter_main_icon_display

  • Returning the CSS class for the main item icon
  • Default value: icon-buddypress (class is: .icon-buddypress)
  • 1 Predefined helper function:
    • __bptb_no_icon_display() -- usage:
add_filter( 'bptb_filter_main_icon_display', '__bptb_no_icon_display' );

--> This way you can REMOVE the icon!

  • Another example:
add_filter( 'bptb_filter_main_icon_display', 'custom_bptb_main_icon_display_class' );
/**
 * BuddyPress Toolbar: Change Main Icon CSS Class
 */
function custom_bptb_main_icon_display_class() {
    return 'your-custom-icon-class';
}

--> You then have to define CSS rules in your theme/child theme stylesheet for your own custom class .your-custom-icon-class

--> Recommended dimensions are 16px x 16px

bptb_filter_main_item_title

  • Default value: "BuddyPress"
  • Example code for your theme's/child theme's functions.php file:
add_filter( 'bptb_filter_main_item_title', 'custom_bptb_main_item_title' );
/**
 * BuddyPress Toolbar: Change Main Item Name
 */
function custom_bptb_main_item_title() {
    return __( 'Your custom main item title', 'your-textdomain' );
}

bptb_filter_main_item_title_tooltip

  • Default value: "BuddyPress"
  • Example code for your theme's/child theme's functions.php file:
add_filter( 'bptb_filter_main_item_title_tooltip', 'custom_bptb_main_item_title_tooltip' );
/**
 * BuddyPress Toolbar: Change Main Item Name's Tooltip
 */
function custom_bptb_main_item_title_tooltip() {
    return __( 'Your custom main item title tooltip', 'your-textdomain' );
}

bptb_filter_buddypress_name and bptb_filter_buddypress_name_tooltip

  • Default value for both: "BuddyPress"
  • Used for some items within toolbar links to enable proper branding
  • Change things like in the other examples/principles shown above

Final note: If you don't like to add your customizations to your theme's/child theme's functions.php file you can also add them to a functionality plugin or an mu-plugin. This way you can also use this better for Multisite environments. In general you are then more independent from child theme changes etc.

All the custom & branding stuff code above can also be found as a Gist on Github: https://gist.github.com/2643807 (you can also add your questions/ feedback there :)

Requires: 3.3 and BuddyPress 1.5+ or higher
Compatible up to: 3.6 Beta
Last Updated: 2013-4-11
Downloads: 69,228

Ratings

4 stars
4.9 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
0 people say it's broken.

100,3,3 100,3,3 100,5,5 100,5,5 100,4,4 100,2,2 100,1,1
83,6,5 80,5,4 100,4,4 100,5,5 100,4,4 100,2,2 100,1,1
100,1,1 100,5,5 100,5,5 100,4,4 100,2,2 100,1,1
100,4,4 100,5,5 100,4,4 100,2,2 100,4,4 100,4,4 100,5,5
100,6,6 100,4,4 100,2,2 100,4,4 100,4,4 100,5,5
100,2,2 100,4,4 100,4,4 100,5,5
100,6,6 100,4,4
100,2,2 88,8,7
100,6,6
100,2,2
100,1,1