apply_filters( 'document_title_parts', array $title )

Filters the parts of the document title.


Parameters

$title array
The document title parts.
  • titlestring
    Title of the viewed page.
  • pagestring
    Optional. Page number if paginated.
  • taglinestring
    Optional. Site description when on home page.
  • sitestring
    Optional. Site title when not on home page.

Top ↑

Source

File: wp-includes/general-template.php. View all references

$title = apply_filters( 'document_title_parts', $title );


Top ↑

Changelog

Changelog
Version Description
4.4.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 2 content
    Contributed by coreytrice

    Make sure your add_filter() comes before the get_header() in your template file if you adding a title filter for that template file.

    <?php
    
    // This filter must be above get_header() to work correctly
    add_filter('document_title_parts', 'callbackFunctionName');
    
    get_header();
    
    ...

You must log in before being able to contribute a note or feedback.