Shortcodes
Shortcodes
Section titled “Shortcodes”BuddyPress Profile Pro registers exactly two shortcodes. Both work in the block editor (add a Shortcode block), the Classic Editor, and any page builder that passes content through do_shortcode().
[wbbpp_show_profile]
Section titled “[wbbpp_show_profile]”Renders the extended profile card for a user — the same content that appears on the Extended Fields profile tab.
Registered in: includes/class-buddypress-profile-pro.php
Handler: Buddypress_Profile_Pro_Public::wbbpp_show_profile_shortcode()
Default template: public/buddypress-template/wbbpp-show-profile.php
Attributes
Section titled “Attributes”This shortcode accepts no attributes. The displayed user is resolved automatically:
- Inside a BuddyPress member profile context (
bp_current_component('members')is true): shows the viewed member (bp_displayed_user_id()). - On any other page (a standalone “My Profile” page, for example): shows the logged-in user (
get_current_user_id()).
Known limitation: Fields within the template are always read with get_current_user_id(), not bp_displayed_user_id(). When the shortcode is placed on a page that is not a BuddyPress profile route, it reliably shows the logged-in user’s data. On a BuddyPress profile route for a different user, the group display is toggled by the viewed user but the field values still come from the logged-in user. Track this as a known issue before relying on it for public member-directory views.
What renders
Section titled “What renders”-
Only field groups that have Display at BuddyPress Profile enabled appear.
-
Groups set to
bprm_sidebararea render inside.bprm-sidebar-content; groups set tobprm_contentrender inside.main-wrapper. -
If no groups have been configured or none have profile display enabled, the shortcode outputs:
<div class="empty-resume-message">Please build up your resume first.</div>
Template override
Section titled “Template override”Copy the default template to your active theme (or child theme) at:
your-theme/buddypress-profile-pro/wbbpp-show-profile.phpThe plugin calls locate_template() first; if your override file exists it is loaded instead of the plugin default.
[wbbpp_show_profile]Typical use case
Section titled “Typical use case”Add this shortcode to a standalone page — for example, “My Extended Profile” — so members can view their profile data without navigating to the standard BuddyPress member profile tab.
[wbbpp_member_form]
Section titled “[wbbpp_member_form]”Renders the member profile search form, which lets visitors filter the BuddyPress members list by extended profile field values.
Registered in: includes/class-buddypress-profile-pro.php
Handler: Buddypress_Profile_Pro_Public::wbbpp_show_member_search_form()
Default template: public/buddypress-template/wbbpp-show-member-search-fields.php
Attributes
Section titled “Attributes”This shortcode accepts no attributes. The fields that appear in the form are determined entirely by the search fields configured at WbCom Plugins > BuddyPress Profile Pro > Settings > Profile Search.
If Enable Profile Search is not checked on that settings tab, the shortcode outputs nothing.
How the search works
Section titled “How the search works”When a visitor submits the form:
- The submitted field values are stored in the
wprm-profile-searchcookie (viawbbpp_set_request()on thewphook). - On the BuddyPress members directory, the
bp_ajax_querystringfilter (wbbpp_filter_members_querystring, priority 99) reads the cookie and restricts the members loop to the matching user IDs. - Clicking the form’s Clear button (or submitting
wbbpp_form=clear) deletes the cookie and resets the list.
The search result is stored in a first-party cookie, so it persists across page navigation within the same session.
Relationship to the auto-injected form
Section titled “Relationship to the auto-injected form”The plugin also injects this same form automatically above the BuddyPress members directory via the bp_before_directory_members_tabs action. Use the shortcode when you want the form elsewhere — a sidebar widget area, a dedicated “Find Members” page, or a custom template.
If you place the shortcode on the members directory page itself, remove the automatic injection to avoid a duplicate form:
add_action( 'init', function() { $public = new Buddypress_Profile_Pro_Public( 'buddypress-profile-pro', WBBPP_PLUGIN_VERSION ); remove_action( 'bp_before_directory_members_tabs', [ $public, 'wbbpp_add_member_search_form' ] );} );[wbbpp_member_form]Typical use case
Section titled “Typical use case”Place this shortcode in a sidebar or on a dedicated search page so visitors can look up members before opening the full /members/ directory.

