wphooks.info - pre_get_document_title

pre_get_document_title

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/general-template.php:
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
	/**
	 * Filters the document title before it is generated.
	 *
	 * Passing a non-empty value will short-circuit wp_get_document_title(),
	 * returning that value instead.
	 *
	 * @since 4.4.0
	 *
	 * @param string $title The document title. Default empty string.
	 */
	$title = apply_filters( 'pre_get_document_title', '' );
	if ( ! empty( $title ) ) {
		return $title;
	}

	global $page, $paged;

	$title = array(
		'title' => '',
	);