WB Ad Manager Pro integrates with BuddyPress and BuddyBoss to embed ad management directly into member profiles. When enabled, advertisers get profile tabs for managing ads, classifieds, and wallet — plus activity stream logging and on-site notifications. The integration module is fully optional and only activates when BuddyPress (or BuddyBoss) is installed and active.
Enabling the Module
- Go to WB Ad Manager -> Pro Settings -> Modules
- Enable BuddyPress Integration
- Click Save Settings
The module checks for BuddyPress at runtime. If BuddyPress is deactivated later, all integration hooks are silently skipped — no errors or broken pages.
Profile Navigation Tabs
When an active advertiser’s profile is viewed, the integration adds navigation tabs to their BuddyPress profile. Tabs only appear for users who have an active advertiser account — pending, suspended, or non-advertiser users do not see these tabs.
Ads Tab
The Ads tab appears at position 80 in the profile nav and contains two sub-navigation items:
| Sub-Nav | Slug | Visibility | Description |
|---|---|---|---|
| My Ads | my-ads |
Public (owner sees all statuses; visitors see published only) | Lists the advertiser’s ads with thumbnail, title, status badge, and relative date |
| Submit Ad | submit-ad |
Owner only | Renders the ad submission form directly in the profile |
Classifieds Tab
The Classifieds tab appears at position 85 and is only registered when the Classifieds module is also enabled. It has three sub-navigation items:
| Sub-Nav | Slug | Visibility | Description |
|---|---|---|---|
| My Classifieds | my-classifieds |
Public (owner sees all statuses; visitors see active only) | Grid display of classified listings with thumbnail, title, price, and status |
| Post Classified | post-classified |
Owner only | Renders the classified submission form in the profile |
| Inquiries | inquiries |
Owner only | Lists received inquiries with sender name, date, message preview, and reply link |
Wallet Tab
The Wallet tab appears at position 90 and is only visible to the profile owner when the Wallet module is enabled. It renders the same wallet interface available in the standalone portal, including balance display, transaction history, and the add-funds form.
Admin Bar Menu
For logged-in advertisers with active accounts, the integration adds items under the BuddyPress My Account admin bar menu:
- Ads — links to the user’s Ads profile tab
- My Ads
- Submit Ad
- Classifieds — links to the Classifieds tab (when the Classifieds module is enabled)
- Wallet — links to the Wallet tab (when the Wallet module is enabled)
Non-advertisers and users with inactive accounts do not see these admin bar items.
Activity Stream
The integration records activity entries in the BuddyPress activity stream when certain events occur. Activities use the wbam component and appear in the sitewide and member activity feeds.
| Activity Type | Hook | Action Text |
|---|---|---|
new_ad |
wbam_ad_approved |
“{User} posted a new ad: {Ad Title}” |
new_classified |
wbam_classified_approved |
“{User} listed: {Title} – {Price}” |
Classified activities include a link to the listing page. Activity entries are only created when the corresponding module (ad submissions or classifieds) is enabled.
Notification Types
The integration registers wbam as a BuddyPress notification component and sends on-site notifications for the following events:
| Notification | Hook | Display Text | Links To |
|---|---|---|---|
| Ad approved | wbam_ad_approved |
“Your ad has been approved” | /ads/ profile tab |
| Ad rejected | wbam_ad_rejected |
“Your ad has been rejected” | /ads/ profile tab |
| Classified approved | wbam_classified_approved |
“Your classified listing has been approved” | /classifieds/ profile tab |
| Classified rejected | wbam_classified_rejected |
“Your classified listing has been rejected” | /classifieds/ profile tab |
| Inquiry received | wbam_inquiry_received |
“You received a new inquiry” | /classifieds/inquiries/ profile tab |
Classified-related notifications are only registered when the Classifieds module is enabled.
Member Directory Filter
The integration adds an Advertisers filter tab to the BuddyPress Members Directory. When a visitor clicks this tab, the directory filters to show only members who are registered advertisers.
This works by hooking into bp_ajax_querystring to inject the user IDs of all active advertisers into the members query. If no advertisers exist, the filter returns an empty result set rather than showing all members.
XProfile Field Mapping
The XProfile_Helper class (Modules/BuddyPress/class-xprofile-helper.php) provides a bridge between BuddyPress extended profile fields and the classified seller profile display.
How It Works
- An admin maps BuddyPress xProfile fields to seller profile display slots in Pro Settings
- When a classified detail page is viewed, the helper fetches the mapped field values for the seller’s user ID
- Mapped fields are displayed on the classified detail page with optional custom labels and icons
Configuration
Field mapping is configured through Settings_Helper::get_xprofile_mapping(), which returns:
- enabled — Whether xProfile mapping is active
- fields — Array of field configurations, each containing:
field_id— The BuddyPress xProfile field IDlabel— Custom display label (falls back to the xProfile field name if empty)icon— Optional icon class for display
Developer Filter
The mapped fields can be modified using the wbam_seller_xprofile_fields filter:
add_filter( 'wbam_seller_xprofile_fields', function( $fields, $user_id ) {
// Add a custom field.
$fields[] = array(
'label' => 'Membership Level',
'value' => get_user_meta( $user_id, 'membership_level', true ),
'icon' => 'dashicons-star-filled',
'field_id' => 0,
);
return $fields;
}, 10, 2 );
BuddyBoss Compatibility
The module checks for both class_exists( 'BuddyPress' ) and function_exists( 'buddypress' ) to ensure compatibility with BuddyBoss Platform, which uses its own bootstrap. All BuddyPress API functions (bp_activity_add, bp_notifications_add_notification, bp_core_new_nav_item, etc.) are guarded with function_exists() checks to prevent fatal errors if the platform is deactivated during a request.
Styles
The integration enqueues two stylesheets on BuddyPress profile pages:
- portal.css — Base portal styles for form rendering
- buddypress.css — BuddyPress-specific layout overrides (depends on portal.css)
The portal.js script is also loaded to provide AJAX form functionality within profile tabs.
Troubleshooting
Profile tabs not appearing
- Confirm BuddyPress or BuddyBoss is active
- Confirm the BuddyPress module is enabled in Pro Settings -> Modules
- Verify the user has an active advertiser account — pending or suspended accounts do not get profile tabs
Classifieds or Wallet tabs missing
- These tabs only appear when their respective modules (Classifieds, Wallet) are enabled in Pro Settings -> Modules
- The Wallet tab is only visible to the profile owner, not to visitors
Activity entries not showing
- Activities are only recorded on the
wbam_ad_approvedandwbam_classified_approvedhooks — ads/classifieds that are auto-published without approval do not generate activity entries - Confirm the BuddyPress Activity component is active
Next Steps
- Email Notifications
- Seller Profiles
- Advertiser Management
