Filter: bricks/get_the_title
Filter: bricks/get_the_title
Section titled “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.).
Parameters
Section titled “Parameters”$title(string): The generated page title.$post_id(int): The ID of the current post or template.
Example usage
Section titled “Example usage”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 ); Was this page helpful?