benecaster_archive_no_results_message
Filters the empty-state message shown in archive/no-results.php when no episodes match the current filters.
Return a plain-text string. Cast with (string) and output through esc_html(), so HTML returned here renders as literal entities — there is no way to inject markup through this filter. Override the archive/no-results.php template instead if markup is needed.
$show_id is 0 on the global archive, so a callback keying off a specific show must test for that rather than assuming a show is always in context.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$message |
string |
— | Empty state message HTML |
$show_id |
int |
— | ID of the show |
Returns:
string
Example
add_filter( 'benecaster_archive_no_results_message', function( $message, $show_id ) {
// Suggest the subscriber feed when no public episodes are found.
$feed_url = benecaster_get_public_feed_url( $show_id );
return '<p>No episodes found. <a href="' . esc_url( $feed_url ) . '">Subscribe to the feed</a> to be notified when new episodes drop.</p>';
}, 10, 2 );
Affects
- archive/no-results.php template part