benecaster_donor_wall_empty_message
Fires inside DonorWallShortcode::render() when the donation query returns zero rows. Receives the fully-wrapped default empty-state HTML — a .benecaster-donor-wall--empty wrapper containing a .benecaster-donor-wall__empty-message element — as $html.
Return any string to replace the empty state entirely. Return $html unchanged to keep the default. Branch on $show_id when only specific shows should use the custom empty state.
The empty state fires whenever the filtered query returns zero rows — including when benecaster_donor_wall_query_args narrows the platform to one that has no donations yet. Design your custom message with that possibility in mind (e.g. “No Stripe donations yet” rather than “No donations yet” if you’re also scoping the query).
Custom Empty State CTA on the Donor Wall
Replace the default “No donations yet” empty state with a bespoke call-to-action block that links to your Listener Support checkout page.
<?php
add_filter( 'benecaster_donor_wall_empty_message', function ( string $html, int $show_id ): string {
$checkout_url = home_url( '/support-the-show/' );
return sprintf(
'<div class="my-theme-donor-wall-empty">'
. '<h3>%s</h3>'
. '<p>%s</p>'
. '<a class="button button-primary" href="%s">%s</a>'
. '</div>',
esc_html__( 'Be the first supporter', 'my-theme' ),
esc_html__( 'Your name lands here the moment your first tip clears.', 'my-theme' ),
esc_url( $checkout_url ),
esc_html__( 'Tip the show', 'my-theme' )
);
}, 10, 2 );
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$html |
string |
— | The default empty-state HTML, fully wrapped in `.benecaster-donor-wall--empty`. |
$show_id |
int |
— | WordPress post ID of the show whose wall returned zero rows. |
Returns:
string
Examples
Replace with a custom CTA block
add_filter( 'benecaster_donor_wall_empty_message', function ( string $html, int $show_id ): string {
return sprintf(
'<div class="my-empty-wall"><h3>%s</h3><a href="%s">%s</a></div>',
esc_html__( 'Be the first supporter', 'my-theme' ),
esc_url( home_url( '/support-the-show/' ) ),
esc_html__( 'Tip the show', 'my-theme' )
);
}, 10, 2 );