pre_get_document_title WordPress Filter Hook

The pre_get_document_title hook gives developers the ability to change the document title that is generated by WordPress. This can be useful for making sure that the title accurately reflects the content of the page.

apply_filters( 'pre_get_document_title', string $title ) #

Filters the document title before it is generated.


Description

Passing a non-empty value will short-circuit wp_get_document_title(), returning that value instead.


Top ↑

Parameters

$title

(string)The document title. Default empty string.


Top ↑

Source

File: wp-includes/general-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More