Tribe__Events__Templates::modify_global_post_title( string $title = '' )
Actually modifies the global $post object’s title property, setting it to an empty string.
Contents
This is expected to be called late on during the wp_title action, but does not in fact alter the string it is passed.
See also
Parameters
- $title
-
(string) (Optional)
Default value: ''
Return
(string)
Source
File: src/Tribe/Templates.php
public static function modify_global_post_title( $title = '' ) {
global $post;
// When in the loop, no need to override titles.
if ( in_the_loop() ) {
return $title;
}
// Set the title to an empty string (but record the original)
self::$original_post_title = $post->post_title;
$post->post_title = apply_filters( 'tribe_set_global_post_title', '' );
// Restore as soon as we're ready to display one of our own views
add_action( 'tribe_pre_get_view', array( __CLASS__, 'restore_global_post_title' ) );
// Now return the title unmodified
return $title;
}