Developer Guide
BuddyPress Member Type overviewFreeGet BuddyPress Member Type →
This page lists the extension points, helper functions, and stored data the plugin uses. All symbols are taken from the plugin source.
The plugin registers no shortcodes and no REST endpoints. It has no settings page of its own; its options live on the BuddyPress member type and profile field screens.
Filters
Section titled “Filters”| Filter | Arguments | Purpose |
|---|---|---|
buddypress_member_type_registration_member_types |
$member_types (type objects keyed by name) |
Filter the types shown as options on the registration form and in the profile fields. This changes what is displayed only; the types a save accepts come from bp_member_type_selectable_types. |
bp_member_types_admin_role_remove |
$remove (default true) |
Return false to keep the Administrator role in the Associated Roles dropdown. |
bp_member_type_remove_membertype_metabox |
$remove (default true) |
Return false to keep BuddyPress’s own member type box on the wp-admin extended profile screen. By default it is removed when a single-selection field exists. |
bp_member_types_count |
$count, $type_id |
Filter the member count shown on a Legacy directory tab. |
bp_member_type_self_service_blocked_caps |
$caps, $role, $ignored |
Capabilities that make a role off limits for self-service. $caps holds the capabilities the role grants beyond the Author set, $role is the role slug, $ignored the plugin capabilities on a stock Subscriber, Contributor or Author role that the default does not count. Return an empty array to let members self-assign the role, or a list to block only those capabilities. Only capabilities the role actually grants are matched. |
bp_member_type_selectable_types |
$selectable, $user_id, $field_id |
The server-side allow-list of member type names the acting user may set through a member type field. Applied on every field save. |
bp_member_type_field_shown_on_profile |
$shown, $field_id |
Whether a member type field is shown to members on their own Edit Profile. Defaults to the Field Display Control setting on BuddyPress and to true on BuddyBoss Platform. |
bp_member_type_get_xprofile_field_id_by_type |
$field_id, $field, $field_type |
Filter the resolved xProfile field id for a given field type. |
buddypress_member_type_wp_cron_disabled |
$disabled |
Whether WP-Cron cannot be relied on to run the background update activation. Defaults to true when DISABLE_WP_CRON is set or the scheduled event is more than an hour overdue; the activation then runs during an admin page load, at most once every 12 hours. A site with a real system cron can return false to keep the background retry. |
Example, letting members pick the Editor role:
add_filter( 'bp_member_type_self_service_blocked_caps', function ( $caps, $role ) { return 'editor' === $role ? array() : $caps;}, 10, 2 );Actions
Section titled “Actions”| Action | Fired in | Notes |
|---|---|---|
bp_member_type_change_user_role |
bp_member_type_change_user_role() |
Fires after a user’s role is changed. Passes the user id and the array of role slugs. |
bp_member_type_meta_field_display |
Field Display Control metabox | Fires inside the metabox, after the checkbox. Passes the xProfile field object. |
bp_member_type_xprofile_save_field |
bp_member_type_xprofile_save_field() |
Fires after the field’s show/hide meta is saved. |
bp_xprofile_field_type_member_types |
Multi field constructor | Fires when the Member Types (checkbox) field type is constructed. |
bp_xprofile_field_type_member_types_radio |
Single field constructor | Fires when the Member Type (radio) field type is constructed. |
BuddyPress hooks the plugin attaches to
Section titled “BuddyPress hooks the plugin attaches to”For reference, these are the BuddyPress hooks the plugin consumes:
bp_get_member_type_tax_labels,bp_get_type_metadata_schema(register the per-type display flags)bp_member_type_add_form_fields,bp_member_type_edit_form_fields(Associated Roles field)bp_type_inserted,bp_type_updated(save the role and directory-exclusion data)bp_members_admin_user_metaboxes,xprofile_field_after_sidebarbox,xprofile_fields_saved_fieldbp_xprofile_get_field_types(register the two field types)bp_set_member_type,bp_remove_member_type,xprofile_data_after_save(two-way sync of type, field and role)bp_after_has_members_parse_args,bp_get_total_member_count,bp_members_directory_member_types,bp_nouveau_get_members_directory_nav_items(directory tabs, counts and exclusion)bp_get_the_profile_field_value(show type labels in the profile)bp_core_activated_user(apply role and registration choice after activation)bp_custom_profile_edit_fields(hide the field on the edit screen when configured)load-users.php(bulk type change)
Helper functions
Section titled “Helper functions”bp_member_type_get_xprofile_field_id_by_type( $field_type = 'member_types' )
Returns the id of the first xProfile field whose type matches $field_type (member_types or member_type_radio), or null if none exists.
bp_member_type_change_user_role( $user_id, $role_slugs = array() )
Changes a user’s role from an array of role slugs. Assigns all roles when User Role Editor is active, otherwise the single role with the most capabilities. Skips Administrator users and keeps forum roles (bbPress, BuddyBoss Forums). Returns true on success or a WP_Error on invalid input.
bp_member_type_sync_user( $user_id, $types = null, $role_mode = 'all' )
The one path every change to a member’s types goes through. $role_mode is 'all' (apply the mapped roles, admin paths), 'self' (member self-service and activation: only member-level roles, never over a higher role) or 'none' (leave roles alone).
bp_member_type_set_types( $user_id, $types )
Sets a user’s member types in the form the active platform accepts: an array on BuddyPress, one type per call on BuddyBoss Platform. Use it instead of calling bp_set_member_type() directly.
bp_member_type_get_selectable_types( $user_id, $field_id )
Returns the member type names the acting user may set for $user_id through a member type field, after the self-service rules and the bp_member_type_selectable_types filter.
bp_member_type_role_is_privileged( $role )
Returns true when the role grants more than a member-level (Author) role, so members may not give it to themselves.
buddypress_member_type_get_registration_member_types()
Returns the member types available for the current context, filtered by the per-type registration and profile-settings flags.
Constants
Section titled “Constants”| Constant | Purpose |
|---|---|
BUDDYPRESS_MEMBER_TYPE_NO_LICENSE_PHONE_HOME |
Set to true to switch off the background update activation (tests, smoke runs). |
BUDDYPRESS_MEMBER_TYPE_LICENCE_HOST |
The update host. Defaults to https://updates.wbcomdesigns.com, with https://wbcomdesigns.com as the fallback. Define it in wp-config.php before the plugin loads to override. |
Options
Section titled “Options”| Option | Type | Set by |
|---|---|---|
buddypress_member_types_exclude_from_members_directoy |
array | Rebuilt when a member type is saved. Holds the types excluded from the directory. Note: the option name contains the misspelling directoy as shipped. |
bp_member_type_update_member_field_enable |
boolean | One-time flag set on admin_init to enable the show-in-profile meta for an existing setup. |
buddypress_member_type_license_key |
string | The free licence key, filled in on the first admin page load after activation. A key you enter yourself is kept. |
buddypress_member_type_preset_activated, _preset_attempts, _preset_gave_up, _preset_refused |
mixed | State of the background update activation: done, number of failed tries, time the store refused, and the store’s reason. |
Term meta (on bp_member_type terms)
Section titled “Term meta (on bp_member_type terms)”| Meta key | Purpose |
|---|---|
bp_member_type_associated_roles |
The WordPress role slug mapped to this type. |
bp_member_type_show_in_registration |
Whether the type appears in the registration form. |
bp_member_type_profile_creation |
Whether the type is pre-selected on registration. |
bp_member_type_show_in_profile_settings |
Whether the type appears in edit-profile settings. |
bp_member_type_exclude_from_members_directoy |
Whether the type is excluded from the directory. Note the directoy spelling as shipped. |
Field meta (on xProfile fields)
Section titled “Field meta (on xProfile fields)”| Meta key | Purpose |
|---|---|
show_hide_member_type |
Whether the member type field is shown on the front-end profile. Value 1 means shown. |

