wp_title хук-фильтрWP 2.0.0

Filters the text of the page title.

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

add_filter( 'wp_title', 'wp_kama_title_filter', 10, 3 );

/**
 * Function for `wp_title` filter-hook.
 * 
 * @param string $title       Page title.
 * @param string $sep         Title separator.
 * @param string $seplocation Location of the separator ('left' or 'right').
 *
 * @return string
 */
function wp_kama_title_filter( $title, $sep, $seplocation ){

	// filter...
	return $title;
}
$title(строка)
Page title.
$sep(строка)
Title separator.
$seplocation(строка)
Location of the separator ('left' or 'right').

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

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

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

wp_title()
wp_title
wp-includes/general-template.php 1449
$title = apply_filters( 'wp_title', $title, $sep, $seplocation );

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

wp-includes/default-filters.php 155
add_filter( $filter, 'wptexturize' );
wp-includes/default-filters.php 156
add_filter( $filter, 'convert_chars' );
wp-includes/default-filters.php 157
add_filter( $filter, 'esc_html' );
wp-includes/default-filters.php 162
add_filter( $filter, 'capital_P_dangit', 11 );