Requires: Charitable Pro 1.8.16+
Charitable Ambassadors 3.0.0+
The Recruit Fundraisers card sits at the top of an eligible ambassador’s My Campaigns page. It shows their personal invite URL, share buttons, a stats line, and a “Your Recruits” toggle – and it’s the most-customized surface in Ambassadors because every program wants to put a slightly different message above the recruit link.
This page is the reference for the filters and actions that let you customize the recruit card without forking the template.
Where it lives
The card renders inside the charitable_ambassadors_my_campaigns_before_grid action – in other words, just before the campaign grid on the [charitable_my_campaigns] page.
Its template path: templates/invite/recruit-card.php. Theme override path: your-theme/charitable-pro/charitable-ambassadors/invite/recruit-card.php.
The most-common customization: Learn more link
Out of the box, the card has no Learn more link – we leave the slot empty so sites that don’t need it stay clean. To turn it on, set both the URL and (optionally) the label:
add_filter( 'charitable_ambassadors_recruit_card_learn_more_url', function () {
return home_url( '/ambassador-handbook/recruiting/' );
} );
add_filter( 'charitable_ambassadors_recruit_card_learn_more_label', function () {
return 'Tips for inviting friends';
} );
The link renders inline at the bottom of the card with an external-link target (so it opens in a new tab without losing the user’s place).
If the URL is empty (default), the slot is suppressed entirely – no empty placeholder.
Inject custom content (footer hook)
For more than a single link – a short pitch, a video embed, a “see top recruiters this week” widget – use the footer action:
add_action( 'charitable_ambassadors_recruit_card_footer', function ( $user_id, $token, $invite_url ) {
echo '<p class="recruit-card-tip">Pro tip: share with two people who would care about this cause.</p>';
echo '<a class="button" href="https://example.com/recruit-video">Watch the 2-minute guide</a>';
}, 10, 3 );
The action runs just above the Learn more slot. Your callback is responsible for its own escaping.
Eligibility – control who sees the card
The card only renders for users who are eligible to recruit. That’s defined by the charitable_ambassadors_user_can_invite filter:
add_filter( 'charitable_ambassadors_user_can_invite', function ( $can, $user_id, $campaign_id_or_null ) {
// Only verified ambassadors can recruit.
if ( '1' !== get_user_meta( $user_id, '_charitable_ambassadors_verified', true ) ) {
return false;
}
return $can;
}, 10, 3 );
The filter is global – it controls both the My Campaigns card AND the per-campaign Recruit popovers AND the admin “view as recruiter” preview.
To override the card’s visibility specifically (without affecting other surfaces), filter charitable_ambassadors_show_recruit_card:
add_filter( 'charitable_ambassadors_show_recruit_card', function ( $show, $user_id ) {
// Hide the card on Mondays. Don't ask.
return $show && 'Mon' !== gmdate( 'D' );
}, 10, 2 );
Customize the empty-state copy
When an inviter has zero recruits yet, the card’s stats line shows a soft “no recruits yet” prompt. Customize that:
add_filter( 'charitable_ambassadors_recruit_card_empty_text', function () {
return 'No recruits yet - your link is ready when you are.';
} );
Mirror filter for the Your Recruits view’s empty state:
add_filter( 'charitable_ambassadors_recruits_view_empty_text', function ( $message, $status, $user_id ) {
if ( 'rejected' === $status ) {
return 'No rejected recruits - your standards are solid!';
}
return $message;
}, 10, 3 );
Body class
The card has its own scoped class for CSS:
.charitable-ambassadors-recruit-card
Drop your overrides under that selector. The card respects the Primary Accent Color via --cap-accent.
Tips
- Add a Learn more link. It’s a low-effort win – even a one-page internal handbook beats no link at all.
- Keep the footer concise. The card is meant to be a tactile CTA, not a lecture. One short line, one button.
- Test on mobile. Long URLs or wide buttons can overflow the card on narrow viewports.
- Filter eligibility for special programs. “Only verified ambassadors can recruit” is a high-leverage policy.
Developer reference
Filters
| Filter | Default | Purpose |
|---|---|---|
charitable_ambassadors_recruit_card_learn_more_url | '' | URL for the Learn more link. Empty suppresses the link. |
charitable_ambassadors_recruit_card_learn_more_label | “Learn more” | Label text. |
charitable_ambassadors_recruit_card_empty_text | computed | Empty-state copy when zero recruits. |
charitable_ambassadors_recruits_view_empty_text | computed | Empty-state copy on the Your Recruits tab. Receives ($message, $status, $user_id). |
charitable_ambassadors_show_recruit_card | computed | Card-specific visibility override. Receives ($show, $user_id). |
charitable_ambassadors_user_can_invite | computed | Underlying eligibility check. Receives ($can, $user_id, $campaign_id). |
charitable_ambassadors_recruit_card_share_networks | site setting | Override which share networks appear on the card. |
Actions
| Action | Args | Fires when |
|---|---|---|
charitable_ambassadors_recruit_card_footer | $user_id, $token, $invite_url | Inside the card, just above the Learn more link. |
charitable_ambassadors_recruit_card_before | $user_id | Just before the card markup begins. |
charitable_ambassadors_recruit_card_after | $user_id | Just after the card markup ends. |
Per-campaign Recruit popover
Parent-campaign owners also get a per-campaign Recruit button in each campaign’s action row. The popover that opens has its own action:
add_action( 'charitable_ambassadors_recruit_popover_footer', function ( $campaign_id, $user_id, $token, $invite_url ) {
echo '<p>Sharing this link recruits for "' . esc_html( get_the_title( $campaign_id ) ) . '" specifically.</p>';
}, 10, 4 );
Template path
templates/invite/recruit-card.php # the My Campaigns recruit card
templates/invite/recruit-card-popover.php # the per-campaign recruit popover
Theme override path: your-theme/charitable-pro/charitable-ambassadors/invite/recruit-card.php.
Capabilities
Public render – the card decides per-user whether to show via the eligibility filter. No capability gate.
Customization examples
Hide the card from administrators (only ambassadors should see it):
add_filter( 'charitable_ambassadors_show_recruit_card', function ( $show, $user_id ) {
$user = get_user_by( 'id', $user_id );
if ( $user && user_can( $user, 'administrator' ) ) {
return false;
}
return $show;
}, 10, 2 );
Add a “Copy short message” button to the card:
add_action( 'charitable_ambassadors_recruit_card_footer', function ( $user_id, $token, $invite_url ) {
$msg = 'Help me fundraise for this cause! ' . $invite_url;
echo '<button class="button" type="button" data-clipboard-text="' . esc_attr( $msg ) . '">Copy short message</button>';
}, 10, 3 );
Render a different card variant for a specific user role:
add_filter( 'charitable_ambassadors_recruit_card_template', function ( $template, $user_id ) {
if ( user_can( $user_id, 'verified_ambassador' ) ) {
return 'recruit-card-verified.php'; // your custom partial
}
return $template;
}, 10, 2 );
Restrict share networks shown on the card to just Copy Link + Email:
add_filter( 'charitable_ambassadors_recruit_card_share_networks', function () {
return [ 'email', 'copy' ];
} );
Related
- Invitations – the parent feature doc.
- My Campaigns – where the card lives.
- Theming – the accent color the card respects.
- Sharing Networks – the network catalog.
- Hooks & filters in Ambassadors – full reference.



