benecaster_listener_support_enabled
Filters whether the Listener Support prompt should render for the given show. Return false to suppress the prompt entirely — useful for geographic restrictions or per-show opt-outs. Default true.
Return a boolean. Cast with (bool); the default is true.
Returning false stops the prompt before any markup is produced — the render method returns false immediately, so no assets are enqueued and no container is emitted. $show_id is 0 when there is no show context, so a callback scoping to one show must handle that rather than assuming a show is present.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$enabled |
bool |
— | Whether Listener Support is enabled; default true |
$show_id |
int |
— | ID of the show |
Returns:
bool
Example
add_filter( 'benecaster_listener_support_enabled', function( $enabled, $show_id ) {
// Disable Listener Support for shows that are set to private.
$is_private = get_post_meta( $show_id, '_benecaster_show_private', true );
if ( $is_private ) {
return false;
}
return $enabled;
}, 10, 2 );
Notes
See the benecaster_listener_support shortcode for placement and configuration options.
Affects
- benecaster_listener_support shortcode
- Listener Support Episode Page block
Need this built rather than just documented? See our services →