benecaster_show_header_title
Filters the show title rendered in show/header.php.
Return a string. The result is cast with (string), so a non-string is coerced rather than raising — an array returned here becomes the literal text Array.
Output is escaped with esc_html() in the <h1> and esc_attr() in the artwork alt, so markup returned here renders as literal entities, not as HTML. Returning an empty string produces an empty heading; it does not suppress the header. To change the title in the RSS feed instead, this is the wrong filter — the feed never renders this template.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$title |
string |
— | Show title |
$show_id |
int |
— | ID of the show |
Returns:
string
Example
add_filter( 'benecaster_show_header_title', function( $title, $show_id ) {
// Append the current season label when a season filter is active.
$season = get_query_var( 'benecaster_season' );
if ( $season ) {
return $title . ': Season ' . absint( $season );
}
return $title;
}, 10, 2 );
Affects
- show/header.php template part