wp-includes/general-template.php:1494Displays or retrieves page title for post.
$prefixstringoptional''$displaybooloptionaltruestring|nullOne hook fires while single_post_title() runs, in this order:
Filters the page title for a single post.
function single_post_title( $prefix = '', $display = true ) { $_post = get_queried_object(); if ( ! isset( $_post->post_title ) ) { return null; } /** * Filters the page title for a single post. * * @since 0.71 * * @param string $_post_title The single post page title. * @param WP_Post $_post The current post. */ $title = apply_filters( 'single_post_title', $_post->post_title, $_post ); if ( $display ) { echo $prefix . $title; } else { return $prefix . $title; }}Introduced in 0.71. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
string|void to string|null.verified against sourcesrc/wp-includes/general-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.