Skip to content
Get Bricks

Filter: bricks/get_the_title

Filters the page title returned by Helpers::get_the_title(). This function determines the appropriate title based on the context (single post, archive, search results, etc.).

  • $title (string): The generated page title.
  • $post_id (int): The ID of the current post or template.
add_filter( 'bricks/get_the_title', function( $title, $post_id ) {
// Example: Add a prefix to the title for search results
if ( is_search() ) {
return 'Searching: ' . $title;
}
return $title;
}, 10, 2 );