Skip to content

Filters Reference

BuddyPress Profile Pro exposes 11 WordPress filters you can hook into from your theme’s functions.php or a site-specific plugin. All filters use the standard add_filter() API.

Do not modify plugin files directly — updates will overwrite your changes.


Add custom field types to the plugin’s field-type dropdown in the admin.

File: admin/inc/wbbpp-resume-filter-functions.php — inside bprm_resume_field_types()

Parameters

Parameter Type Description
$field_types array Associative array of type_slug => Label for every available field type

Built-in slugs

Slug Label
textbox Textbox
textarea Textarea
dropdown Select
year_dropdown Year Dropdown
text_dropdown Textbox & Dropdown Combination
place_autocomplete Google Place Autocomplete
calender_field Calender (note: slug and label both carry this typo — changing either would break stored data)
selectize Selectize
checkbox Checkbox
radio_button Radio Button
email Email
phone_number Phone Number
url URL
image Image

Example — add a “Color Picker” field type:

add_filter( 'wbbpp_add_extra_field_types', function( $field_types ) {
$field_types['color_picker'] = 'Color Picker';
return $field_types;
} );

After registering the slug here, you also need to handle its render output. See wbbpp_render_extra_field_type_content and wbbpp_render_extra_field_type_content_cases below.


Render the display HTML for a custom field type on the extended profile tab. The plugin calls this filter inside the default: branch of a switch statement, so it only fires for field types that are not handled by the built-in cases. Return the HTML string you want output; return an empty string to output nothing.

File: public/buddypress-template/wbbpp-render-profile.php — inside bprm_render_field_type_html_for_resume()

Parameters

Parameter Type Description
$field_type string The field type slug, e.g. color_picker
$value_to_render mixed The stored field value(s) retrieved from user meta
$field_name string The field’s internal meta key

Return: string — HTML to display. No prior HTML is passed through; the return value replaces the default empty string.

Example — render a color swatch for a color_picker field type:

add_filter( 'wbbpp_render_extra_field_type_content', function( $field_type, $value, $field_name ) {
if ( 'color_picker' !== $field_type ) {
return '';
}
$color = is_array( $value ) ? esc_attr( $value[0][0] ?? '' ) : esc_attr( $value );
return '<span class="color-swatch" style="background:' . $color . '; display:inline-block; width:24px; height:24px;"></span>';
}, 10, 3 );

wbbpp_render_extra_field_type_content_cases

Section titled “wbbpp_render_extra_field_type_content_cases”

Render the display HTML for a custom field type in the profile loop view. This filter is the counterpart to wbbpp_render_extra_field_type_content but fires from a different template used when rendering profiles within the members directory loop. When adding a new field type, hook both filters so the type renders correctly everywhere.

File: public/buddypress-template/wbbpp-profile-render-cases.php

Parameters — identical to wbbpp_render_extra_field_type_content:

Parameter Type Description
$field_type string The field type slug
$value_to_render mixed The stored field value(s)
$field_name string The field’s internal meta key

Return: string — HTML to display.


Add display areas for field groups. By default, groups can be placed in the “Content Area” or the “Sidebar” of the profile tab. Use this filter to introduce additional layout regions your theme supports.

File: admin/inc/wbbpp-resume-filter-functions.php — inside bprm_groups_display_area()

Parameters

Parameter Type Description
$group_area array Associative array of area_slug => Label

Default value:

[
'bprm_content' => 'Content Area',
'bprm_sidebar' => 'Sidebar',
]

Example — add a “Footer” area:

add_filter( 'wbbpp_add_extra_grp_area', function( $group_area ) {
$group_area['bprm_footer'] = 'Footer';
return $group_area;
} );

Modify the default field groups seeded on first activation. The plugin ships three default groups: Education, Professional Experience, and Contact Details. Use this filter to add, remove, or change those defaults before they are written to the database.

This filter only runs during first-activation seeding. To change groups on a live site, use the admin UI at Settings > Group Settings.

File: admin/inc/wbbpp-resume-filter-functions.php — inside bprm_existing_resume_groups()

Parameters

Parameter Type Description
$grp_args array Associative array of group configurations, keyed by group slug

Each group entry supports these keys:

Key Type Description
g_name string Display name
g_desc string Description shown in the admin
g_key string Must match the array key (the group slug)
g_area string bprm_content or bprm_sidebar
profile_display string yes to show on the profile tab
resume_display string yes to show on the resume view
repeater string yes to enable repeater rows for this group

Example — add a “Skills” group on first activation:

add_filter( 'wb_wbbpp_profile_groups', function( $grp_args ) {
$grp_args['bprm_skills'] = [
'g_name' => 'Skills',
'g_desc' => 'Skills and competencies.',
'g_key' => 'bprm_skills',
'g_area' => 'bprm_content',
'profile_display' => 'yes',
'resume_display' => 'no',
'repeater' => 'no',
];
return $grp_args;
} );

Control whether a specific extended field is shown to the current visitor when the profile is rendered inside the member loop.

The built-in access logic (bppro_exprofile_field_access()) checks:

  • Is the viewer the profile owner? Always show.
  • Is the field set to “Friends only”? Show only if the viewer is a BuddyPress friend.
  • Is the field set to “Admins only”? Block non-owners.
  • Is the field set to “Logged in only”? Block logged-out visitors.

This filter receives the result of that check as $access. Return false to block access, true to grant it.

File: public/buddypress-template/wbbpp-profile-loop-userdata.php

Parameters

Parameter Type Description
$access bool Result of the built-in access check

Example — require a custom capability before showing any extended fields:

add_filter( 'bppro_exprofile_field_access_filter', function( $access ) {
if ( ! current_user_can( 'verified_member' ) ) {
return false;
}
return $access;
} );

Override the computed visibility for a single field when it is being rendered on a profile page. This filter fires once per field per page load, after the plugin evaluates the member’s saved visibility preference (public / logged-in / friends / admins only).

File: public/buddypress-template/wbbpp-dropdown-options.php — inside wbbpp_get_field_visibility_level()

Parameters

Parameter Type Description
$field_visibility bool true = show the field, false = hide it
$field_name string The field’s internal meta key

Example — force a specific field to always be visible regardless of the member’s visibility setting:

add_filter( 'wbbpp_field_visibility_filter', function( $visibility, $field_name ) {
if ( 'bprms_public_bio' === $field_name ) {
return true;
}
return $visibility;
}, 10, 2 );

Modify the comparison operators available in the member search form. The default operators are “contains”, “is”, “is like”, “is one of”, “match any”, and “match all”. The plugin automatically removes operators that do not apply to a given field type (for example, range operators are removed from plain text fields).

File: buddypress-profile-pro.php — inside wbbpp_get_bprm_search_filters()

Parameters

Parameter Type Description
$labels array Associative array of operator_key => Label

Default keys:

Key Label
contains contains
`` (empty string) is
like is like
one_of is one of
match_any match any
match_all match all

Example — remove “match any” from the operator list:

add_filter( 'bprm_search_filters_selector', function( $labels ) {
unset( $labels['match_any'] );
return $labels;
} );

Filter the array of matching user IDs just before they are passed to the BuddyPress members loop. Use this to add or remove users from search results after the plugin’s own query has run.

File: public/class-buddypress-profile-pro-public.php — inside wbbpp_filter_members_querystring()

Parameters

Parameter Type Description
$users array Flat array of matching WordPress user IDs

Example — exclude a site-managed list of banned users from results:

add_filter( 'wbbpp_search_results', function( $users ) {
$banned = get_option( 'my_banned_users', [] );
return array_diff( $users, $banned );
} );

Filter the complete search result set, including the original request data and the configured search-field settings. This fires after all field-matching is complete, giving access to the full context of the search.

File: public/class-buddypress-profile-pro-public.php — inside wbbpp_search_users()

Parameters

Parameter Type Description
$results array Array with keys users (array of user IDs) and validated (bool)
$request array Parsed search form POST data
$profile_search_fields array Admin-configured search field settings from the wbbpp_profile_search_fields option
$bprm_settings array Full profile fields settings from the wbbpp_profile_fields_settings option

Example — log every member search with a result count:

add_filter( 'wbbpp_search_users', function( $results, $request, $fields, $settings ) {
error_log( 'Profile search returned ' . count( $results['users'] ) . ' users.' );
return $results;
}, 10, 4 );

Add or remove tabs in the plugin’s admin page sidebar. Tab slugs must be unique. Adding a tab only registers it in the navigation — rendering its content requires checking $_GET['tab'] in your own code and outputting the HTML for that tab.

File: includes/admin/class-bppp-admin.php — inside BPPP_Admin::get_tabs()

Parameters

Parameter Type Description
$tabs array Associative array of tab configurations, keyed by tab slug

Each tab entry:

Key Type Description
label string Displayed tab name (translatable)
icon string Dashicons class, e.g. dashicons-admin-generic
group string settings, main, or account — controls which nav group the tab appears in

Example — add a custom extension tab:

add_filter( 'buddypress_profile_pro_admin_setting_tabs', function( $tabs ) {
$tabs['my_extension'] = [
'label' => __( 'My Extension', 'my-plugin' ),
'icon' => 'dashicons-admin-plugins',
'group' => 'settings',
];
return $tabs;
} );

Filter Fires in Parameters
wbbpp_add_extra_field_types Admin field-type list $field_types (array)
wbbpp_render_extra_field_type_content Profile tab render $field_type, $value_to_render, $field_name
wbbpp_render_extra_field_type_content_cases Member loop render $field_type, $value_to_render, $field_name
wbbpp_add_extra_grp_area Admin group area list $group_area (array)
wb_wbbpp_profile_groups First-activation seeding $grp_args (array)
bppro_exprofile_field_access_filter Member loop field display $access (bool)
wbbpp_field_visibility_filter Profile page field display $field_visibility (bool), $field_name (string)
bprm_search_filters_selector Search form operator list $labels (array)
wbbpp_search_results Member search query result $users (array)
wbbpp_search_users Member search full result $results, $request, $profile_search_fields, $bprm_settings
buddypress_profile_pro_admin_setting_tabs Admin sidebar tabs $tabs (array)