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 1274
$title = apply_filters( 'document_title', $title );

Where the hook is used in WordPress

wp-includes/default-filters.php 147
add_filter( $filter, 'wptexturize' );
wp-includes/default-filters.php 148
add_filter( $filter, 'convert_chars' );
wp-includes/default-filters.php 149
add_filter( $filter, 'esc_html' );
wp-includes/default-filters.php 154
add_filter( $filter, 'capital_P_dangit', 11 );