Tiered Credit Pricing
Charge different credit costs to different members by applying a percentage multiplier to the base cost. A premium PMPro level might post jobs at 0% (free); a basic member pays 100% (full price); a discounted tier pays 50%. The rules live in one option, keyed by membership source.
It is a multiplier, not a flat price. The matrix stores a percentage (0-100, or higher to mark up). The final cost is
round( base_cost * multiplier / 100 ), floored at 0. A multiplier of0means free for that tier;100means full price;50means half.
Loaded outside the BuddyPress gate. This integration runs on PMPro / MemberPress sites without BuddyPress too - it reads whichever source the user belongs to and applies the lowest matching multiplier.
How it works
Section titled “How it works”BpTieredCreditCost hooks the wcbp_consumer_cost filter, which Career
Board fires for the job_post consumer (base = the board’s per-board
credit_cost) and the featured_upgrade consumer (base = the
wcbp_featured_upgrade_cost option). It reads a single option,
wcbp_credit_cost_matrix, keyed by:
consumer -> source -> key -> multiplier (percentage)When a user posts a job (or upgrades a job to featured), the integration checks every source the user belongs to, collects the matching multipliers, and applies the lowest one. If the base cost is 0 or there is no logged-in user, the base cost passes through unchanged.
The three sources
Section titled “The three sources”| Source key | What the inner key is | Resolved by |
|---|---|---|
bp_type |
BuddyPress member-type slug | bp_get_member_type() |
pmpro |
Paid Memberships Pro level id (integer) | pmpro_getMembershipLevelForUser() |
memberpress |
MemberPress membership id (integer) | MeprUser::active_product_subscriptions( 'ids' ) |
A source only contributes a multiplier when its plugin is active and the user actually belongs to a listed tier. PMPro and MemberPress are keyed by numeric membership id, not by slug.
The matrix shape
Section titled “The matrix shape”update_option( 'wcbp_credit_cost_matrix', array( 'job_post' => array( 'bp_type' => array( 'mentor' => 0, // BP member type "mentor" posts free 'company' => 100, // company members pay full price 'staff' => 25, // staff pay a quarter ), 'pmpro' => array( 2 => 0, // PMPro level id 2 posts free 3 => 50, // PMPro level id 3 pays half ), 'memberpress' => array( 7 => 0, // MemberPress membership id 7 posts free ), ), 'featured_upgrade' => array( 'pmpro' => array( 2 => 0, // level id 2 upgrades to featured for free ), ),) );If a user is both pmpro level 3 (multiplier 50) and bp_type
mentor (multiplier 0), the integration applies 0 because the lowest
multiplier wins.
Free posting for paid members
Section titled “Free posting for paid members”The most common configuration: free job posts for paying members, full price for everyone else.
- Leave the board’s base
credit_costat your full price (say 10). - Add a
0multiplier for the paid level(s) in the matrix.
update_option( 'wcbp_credit_cost_matrix', array( 'job_post' => array( 'pmpro' => array( 2 => 0, // Premium: free 3 => 50, // Pro: half price (5 credits on a 10 base) ), ),) );Members with no listed tier just pay the base cost.
Resolution rules
Section titled “Resolution rules”- If base cost is 0 or there is no logged-in user, return the base cost.
- Read the rules for this consumer (
job_post/featured_upgrade); if none, return the base cost. - Collect the lowest multiplier from each source the user belongs to (BP member types, PMPro level, MemberPress memberships).
- If no source matched, return the base cost. Otherwise apply
round( base * min(multipliers) / 100 ), floored at 0.
No admin screen yet
Section titled “No admin screen yet”This release has no settings UI for the matrix. Set
wcbp_credit_cost_matrix with update_option() (a small mu-plugin or a
WP-CLI wp option update --format=json call works well). The BuddyPress
card under Career Board → Settings → Integrations covers the profile
tabs and notification toggles only, not tiered pricing.
Programmatic tweaks
Section titled “Programmatic tweaks”wcbp_consumer_cost runs at priority 10 inside the integration, so a
higher priority overrides it:
// Always charge full price for one tagged employer, regardless of their tier.add_filter( 'wcbp_consumer_cost', function ( $cost, $user_id, $item_id, $board_id, $consumer ) { if ( 'job_post' === $consumer && in_array( 'enterprise_customer', wp_get_object_terms( $user_id, 'employer_tag', array( 'fields' => 'slugs' ) ), true ) ) { return 10; } return $cost;}, 20, 5 );
