For developers who need more control than the settings provide, the BuddyPress and BuddyBoss Integration Add On offers several filter hooks and one action hook. Use them to change a user’s community access in code, adjust who appears in the member directory, and customize the Membership tab on profiles.

Add custom code to your site with a customizations plugin or the Code Snippets plugin.

Filters

pmpro_bp_get_user_options

Filters the combined community settings for a user, after the Add On merges your Non-member User Settings with the settings of every active level the user holds. Use it to grant or remove access to specific features for certain users. Groups in the returned group lists can be joined and viewed even without Joining Groups access. This filter doesn’t change which groups a member is added to or which member types they get, since those come from each level’s settings.

apply_filters( 'pmpro_bp_get_user_options', array $pmpro_bp_all_options, int $user_id );

Parameters

  • $pmpro_bp_all_options: array; The user’s combined settings. Keys are pmpro_bp_restrictions (-1 lock all, 1 unlock all, 2 specific features), the feature keys pmpro_bp_group_creation, pmpro_bp_group_single_viewing, pmpro_bp_groups_page_viewing, pmpro_bp_groups_join, pmpro_bp_private_messaging, pmpro_bp_public_messaging, pmpro_bp_send_friend_request, pmpro_bp_member_directory, pmpro_bp_docs_view, and pmpro_bp_docs_upload (each 1 or 0), plus the arrays pmpro_bp_group_automatic_add, pmpro_bp_group_can_request_invite, and pmpro_bp_member_types.
  • $user_id: int; The ID of the user. Defaults to the current user, or 0 for logged-out visitors.

pmpro_bp_user_can

Filters whether a user can use a specific community feature. Return true to allow access or false to block it. By default, access is allowed if the user’s settings unlock all of BuddyPress or unlock the feature being checked. The Add On uses this filter at priority 10 to allow access for administrators (users who can manage site options), so use a later priority to override that.

apply_filters( 'pmpro_bp_user_can', bool $can, string $check, int $user_id );

Parameters

  • $can: bool; Whether the user can use the feature.
  • $check: string; The feature being checked, always prefixed with pmpro_bp_. The Add On checks pmpro_bp_group_creation, pmpro_bp_group_single_viewing, pmpro_bp_groups_page_viewing, pmpro_bp_groups_join, pmpro_bp_private_messaging, pmpro_bp_public_messaging, pmpro_bp_send_friend_request, pmpro_bp_docs_view, and pmpro_bp_docs_upload.
  • $user_id: int; The ID of the user. Defaults to the current user.

pmpro_bp_directory_sql_parts

Filters each part of the SQL query that builds the list of users shown in the Members directory. This query only runs when your Non-member User Settings limit the directory. Use it to extend the query, for example to join another table or add conditions.

apply_filters( 'pmpro_bp_directory_sql_parts', array $sql_parts, array $include_levels );

Parameters

  • $sql_parts: array; The query parts, keyed SELECT, JOIN, WHERE, GROUP, ORDER, and LIMIT. By default, the query selects the IDs of users with an active membership in one of the included levels.
  • $include_levels: array; IDs of the membership levels whose members are included in the directory (levels that unlock all of BuddyPress or have Include in Member Directory set to Yes).

pmpro_buddypress_profile_account_shortcode

Filters the content of the Membership tab on a member’s own profile. Return a different shortcode, a shortcode with attributes, or your own HTML.

Read Customize the Membership Tab of the BuddyPress User Profile for examples.

apply_filters( 'pmpro_buddypress_profile_account_shortcode', string $content );

Parameters

  • $content: string; The content shown in the Membership tab. Default [pmpro_account].

Actions

pmpro_bp_redirect_to_access_required_page

Fires right before the Add On redirects a user who doesn’t have access to a community feature. The redirect goes to the Access Restricted page, or to the Membership Levels page or home page if the Access Restricted page isn’t set. Use this hook to log the attempt, or to send the user somewhere else with your own redirect and exit.

do_action( 'pmpro_bp_redirect_to_access_required_page' );

Parameters

None.

Last updated on November 12, 2026


Was this article helpful?
YesNo