WordPress.org

Ready to get started?Download WordPress

Plugin Directory

bbPress Admin Bar Addition

This plugin adds useful admin links and resources for the bbPress 2.x Forum Plugin to the WordPress Toolbar / Admin Bar.

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

Yes, this plugin works really fine with WordPress 3.3+! It also works great with WP 3.2 branch - and also should with WP 3.1 branch - but we only tested extensively with WP 3.3+ and 3.2 branch. So you always should run the latest WordPress version for a lot of reasons.

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 bbPress 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 bbPress 2.x out there why aren't these included by default?

Simple answer: The settings of these add-ons are added directly to the bbPress main settings page and have no anchor to link to. So linking/ adding is just not possible.

Is this plugin Multisite compatible?

Yes, it is! :) Works really fine in Multisite invironment - here I just recommend to activate on a per site basis so to load things only where and when needed.

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

Yes, you could. -- However, it doesn't make much sense. The plugin is intented for a per site use as the admin links refer to the special settings, plugin-support and theme-support for that certain site/blog. So if you have a Multisite install with 5 sites but only 3 would run "bbPress 2.x" the the other 2 sites will only see support links in the Toolbar / Admin Bar... I guess, you got it? :)

Though intended for a per site use it could make some sense in such an edge case: if all of the sites in Multisite use bbPress 2.x and have lots of bbPress-specific plugins in common and use the same theme/framework. This might be the case if you use Multisite for multilingual projects, especially via that awesome plugin: http://wordpress.org/extend/plugins/multilingual-press/

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

Yes, this is possible since version 1.5 of the plugin! There are 5 action hooks available for hooking custom menu items in -- bbpaba_custom_main_items for the main section, bbpaba_custom_forum_items for the Forums sub-level section (frontend links), bbpaba_custom_extension_items for the exentensions section, bbpaba_custom_theme_items for the theme section plus bbpaba_custom_group_items for the resource group section. Here's an example code:

add_action( 'bbpaba_custom_group_items', 'bbpaba_custom_additional_group_item' );
/**
 * bbPress Admin Bar Addition: Custom Resource Group Items
 *
 * @global mixed $wp_admin_bar
 */
function bbpaba_custom_additional_group_item() {

    global $wp_admin_bar;

    $wp_admin_bar->add_menu( array(
        'parent' => 'ddw-bbpress-bbpgroup',
        '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: "Extensions" area (all items) / "Theme" (all items!) / "Resources link group" at the bottom (all items) / "German language stuff" (all items)

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

/** bbPress Admin Bar Addition: Remove Extensions Items */
define( 'BBPABA_EXTENSIONS_DISPLAY', FALSE );

/** bbPress Admin Bar Addition: Remove Theme Items */
define( 'BBPABA_THEME_DISPLAY', FALSE );

/** bbPress Admin Bar Addition: Remove Resource Items */
define( 'BBPABA_RESOURCES_DISPLAY', FALSE );

/** bbPress Admin Bar Addition: Remove German Language Items */
define( 'BBPABA_DE_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 "bbPress Admin Bar Addition" items for all user roles of "Editor" please use this code:

/** bbPress Admin Bar Addition: Remove all items for "Editor" user role */
if ( current_user_can( 'editor' ) ) {
    define( 'BBPABA_DISPLAY', FALSE );
}

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

/** bbPress Admin Bar Addition: Remove all items for user ID 2 */
if ( 2 == get_current_user_id() ) {
    define( 'BBPABA_DISPLAY', FALSE );
}

To hide items only in frontend use this code:

/** bbPress Admin Bar Addition: Remove all items from frontend */
if ( ! is_admin() ) {
    define( 'BBPABA_DISPLAY', FALSE );
}

In general, use this constant do hide any "bbPress Admin Bar Addition" items:

/** bbPress Admin Bar Addition: Remove all items */
define( 'BBPABA_DISPLAY', FALSE );

Can I remove the original Toolbar items for "GD bbPress Tools" or "GB bbPress Toolbox (Pro)"?

Yes, this is also possible! Since v1.5+ of my plugin support for GD bbPress Tools" and "GD bbPress Toolbox (Pro)" (both by Milan Petrovic of Dev4Press) is included so if you only want his stuff to appear within "bbPress Admin Bar Addition" just add this constant to your active theme's/child theme's functions.php file or functionality plugin:

/** bbPress Admin Bar Addition: Remove original GD bbPress Tools items */
define( 'BBPABA_REMOVE_GDBBPRESSTOOLS_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.

bbpaba_filter_capability_all

  • Default value: moderate (bbPress admin stuff should only be done by at least "Moderators", right?!)
  • 7 Predefined helper functions:
    • __bbpaba_admin_only -- returns 'administrator' role -- usage:
add_filter( 'bbpaba_filter_capability_all', '__bbpaba_admin_only' );
  • __bbpaba_role_editor -- returns 'editor' role -- usage:
add_filter( 'bbpaba_filter_capability_all', '__bbpaba_role_editor' );
  • __bbpaba_role_bbp_moderator -- returns 'bbp_moderator' role -- usage:
add_filter( 'bbpaba_filter_capability_all', '__bbpaba_role_bbp_moderator' );
  • __bbpaba_cap_moderate -- returns 'moderate' capability -- usage:
add_filter( 'bbpaba_filter_capability_all', '__bbpaba_cap_moderate' );
  • __bbpaba_cap_manage_options -- returns 'manage_options' capability -- usage:
add_filter( 'bbpaba_filter_capability_all', '__bbpaba_cap_manage_options' );
  • __bbpaba_cap_install_plugins -- returns 'install_plugins' capability -- usage:
add_filter( 'bbpaba_filter_capability_all', '__bbpaba_cap_install_plugins' );
  • __bbpaba_cap_edit_theme_options -- returns 'edit_theme_options' capability -- usage:
add_filter( 'bbpaba_filter_capability_all', '__bbpaba_cap_edit_theme_options' );
  • Another example:
add_filter( 'bbpaba_filter_capability_all', 'custom_bbpaba_capability_all' );
/**
 * bbPress Admin Bar Addition: Change Main Capability
 */
function custom_bbpaba_capability_all() {
    return 'activate_plugins';
}

--> Changes the capability to activate_plugins

bbpaba_filter_main_icon

  • Default value: bbPress bee logo :)
  • 10 Predefined helper functions for the 10 included colored icons, returning special colored icon values - the helper function always has this name: __bbpaba_colornamehere_icon() this results in the following filters ready for usage:
add_filter( 'bbpaba_filter_main_icon', '__bbpaba_blue_icon' );

add_filter( 'bbpaba_filter_main_icon', '__bbpaba_brown_icon' );

add_filter( 'bbpaba_filter_main_icon', '__bbpaba_gray_icon' );

add_filter( 'bbpaba_filter_main_icon', '__bbpaba_green_icon' );

add_filter( 'bbpaba_filter_main_icon', '__bbpaba_khaki_icon' );

add_filter( 'bbpaba_filter_main_icon', '__bbpaba_orange_icon' );

add_filter( 'bbpaba_filter_main_icon', '__bbpaba_pink_icon' );

add_filter( 'bbpaba_filter_main_icon', '__bbpaba_red_icon' );

add_filter( 'bbpaba_filter_main_icon', '__bbpaba_turquoise_icon' );

add_filter( 'bbpaba_filter_main_icon', '__bbpaba_alternate_icon' );

add_filter( 'bbpaba_filter_main_icon', '__bbpaba_theme_images_icon' );

--> Where the 2nd to last "alternate" icon returns the same icon as in the left-hand "Forums" menu!

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

  • Example for using with current child theme:
add_filter( 'bbpaba_filter_main_icon', 'custom_bbpaba_main_icon' );
/**
 * bbPress Admin Bar Addition: Change Main Icon
 */
function custom_bbpaba_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

bbpaba_filter_main_icon_display

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

--> This way you can REMOVE the icon!

  • Another example:
add_filter( 'bbpaba_filter_main_icon_display', 'custom_bbpaba_main_icon_display_class' );
/**
 * bbPress Admin Bar Addition: Change Main Icon CSS Class
 */
function custom_bbpaba_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

bbpaba_filter_main_item_title

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

bbpaba_filter_main_item_title_tooltip

  • Default value: "bbPress Forums"
  • Example code for your theme's/child theme's functions.php file:
add_filter( 'bbpaba_filter_main_item_title_tooltip', 'custom_bbpaba_main_item_title_tooltip' );
/**
 * bbPress Admin Bar Addition: Change Main Item Name's Tooltip
 */
function custom_bbpaba_main_item_title_tooltip() {
    return __( 'Your custom main item title tooltip', 'your-textdomain' );
}

bbpaba_filter_bbpress_name and bbpaba_filter_bbpress_name_tooltip

  • Default value for both: "bbPress"
  • 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 theme/child theme changes etc.

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

Requires: 3.1 or higher
Compatible up to: 3.4.2
Last Updated: 2012-8-28
Downloads: 40,772

Ratings

5 stars
5 out of 5 stars

Support

0 of 1 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1
100,2,2 100,1,1 100,1,1 100,1,1 100,2,2
100,2,2 100,1,1 100,3,3 100,3,3 100,4,4 100,4,4 100,2,2 100,3,3 100,2,2
100,3,3 100,5,5 100,4,4 100,4,4 100,2,2 100,3,3 100,2,2
100,1,1 100,4,4 100,2,2 100,3,3 100,2,2
0,1,0 100,5,5 100,4,4 100,2,2
100,4,4 100,4,4 100,2,2
100,2,2
100,5,5
100,1,1