Used By
Used By | Description |
---|---|
wp-includes/general-template.php: wp_title() | Display or retrieve page title for all areas of blog. |
Filters the text of the page title.
(string) Page title.
(string) Title separator.
(string) Location of the separator ('left' or 'right').
The wp_title
filter is used to filter the title of the page (called with wp_title()
). This filters the text appearing in the HTML <title> tag (sometimes called the “title tag” or “meta title”), not the post, page, or category title.
A plugin (or theme) can register as a content filter with the code:
add_filter( 'wp_title', 'filter_function_name', 10, 2 );
Where ‘filter_function_name’ is the function WordPress should call when the content is being retrieved. Note that the filter function must return the content after it is finished processing, or the title will be blank and other plugins also filtering the content may generate errors.
filter_function_name should be unique function name. It cannot match any other function name already declared.
Version | Description |
---|---|
2.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_title