single_post_title хук-фильтрWP 0.71

Filters the page title for a single post.

Использование

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(строка)
The single post page title.
$_post(WP_Post)
The current post.

Список изменений

С версии 0.71 Введена.

Где вызывается хук

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

Где используется хук в WordPress

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