Skip to main content

benecaster_archive_header_title

Filter Free

Filters the archive heading text rendered in archive/header.php.

Return a string. Cast with (string); output through esc_html() in the heading and esc_attr() in the artwork alt, so markup becomes literal text. Returning '' renders an empty heading rather than suppressing it.

Parameters

Name Type Default Description
$title string Archive heading text
$show_id int ID of the show

Returns: string

Example

add_filter( 'benecaster_archive_header_title', function( $title, $show_id ) {
    // Append the show season number when a season query var is active.
    $season = get_query_var( 'benecaster_season' );
    if ( $season ) {
        return $title . ' — Season ' . absint( $season );
    }
    return $title;
}, 10, 2 );

Affects

  • archive/header.php template part