benecaster_donation_confirmation_message
Fires during shortcode rendering when the (initially hidden) confirmation screen is built. The $amount and $currency are the values at render time — the confirmation screen is pre-rendered at page load and revealed client-side after payment.
Return a string. Cast with (string).
$amount is 0.0 here, not the donation amount. This filter runs at config-fetch time, before any donation exists — the parameter is present for signature stability. A callback interpolating it into a thank-you message will publish “Thank you for your $0.00” to every donor.
When a real amount is available elsewhere in this subsystem it is in major units (dollars, not cents) — never divide by 100.
$show_id is 0 when there is no show context.
What you return is rendered as HTML. It passes through wp_kses_post(), so post-safe markup (<em>, <strong>, <a>, <p>) survives and <script> or event attributes do not. The message sits in a <div>, so block markup is valid. The placeholders {amount_formatted}, {amount}, {currency} and {donor_name} are filled in the browser with the real donation, and every value put in is HTML-escaped. Use them, not $amount, to show what was given. The saved setting this filter receives is plain text; markup can only come from a filter.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$message_html |
string |
— | Rendered HTML of the configurable thank-you message |
$show_id |
int |
— | ID of the show |
$amount |
float |
— | Donation amount in major units at render time |
$currency |
string |
— | ISO 4217 currency code, uppercase (e.g. USD) |
Returns:
string
Example
add_filter( 'benecaster_donation_confirmation_message', function ( string $message_html ): string {
return '<strong>Thank you, {donor_name}!</strong> <a href="/members/">See what members get</a>';
} );
Need this built rather than just documented? See our services →