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 🙂