document_title filter-hookWP 5.8.0

Filters the document title.

Usage

add_filter( 'document_title', 'wp_kama_document_title_filter' );

/**
 * Function for `document_title` filter-hook.
 * 
 * @param string $title Document title.
 *
 * @return string
 */
function wp_kama_document_title_filter( $title ){

	// filter...
	return $title;
}
$title(string)
Document title.

Changelog

Since 5.8.0 Introduced.

Where the hook is called

wp_get_document_title()
document_title
wp-includes/general-template.php 1294
$title = apply_filters( 'document_title', $title );

Where the hook is used in 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 );