single_post_title filter-hookWP 0.71

Filters the page title for a single post.

Usage

add_filter( 'single_post_title', 'wp_kama_single_post_title_filter', 10, 2 );

/**
 * Function for `single_post_title` filter-hook.
 * 
 * @param string  $_post_title The single post page title.
 * @param WP_Post $_post       The current post.
 *
 * @return string
 */
function wp_kama_single_post_title_filter( $_post_title, $_post ){

	// filter...
	return $_post_title;
}
$_post_title(string)
The single post page title.
$_post(WP_Post)
The current post.

Changelog

Since 0.71 Introduced.

Where the hook is called

single_post_title()
single_post_title
wp-includes/general-template.php 1500
$title = apply_filters( 'single_post_title', $_post->post_title, $_post );

Where the hook is used in WordPress

wp-includes/default-filters.php 168
add_filter( $filter, 'wptexturize' );
wp-includes/default-filters.php 169
add_filter( $filter, 'strip_tags' );