WordPress 4.4 to Deprecate the wp_title Function

A year after WordPress 4.1 introduced a new way to display titles in themes, WordPress 4.4 will deprecate wp_title(). With the change, plugin authors will be able to check for theme support and use a few new filters to manipulate the title. The new filters are as follows:

  • 'pre_get_document_title' short-circuits wp_get_document_title() if it returns anything other than an empty value.
  • 'document_title_separator' filters the separator between title parts.
  • 'document_title_parts' filters the parts that make up the document title, passed in an associative array.

Theme authors should no longer use wp_title() to generate document titles. If theme authors add add_theme_support( ‘title-tag’ ); to the after_setup_theme callback, the title will be handled natively via an internal WordPress core function. If you use a theme that utilizes wp_title and have wp_debug enabled in WordPress 4.4, you’ll see a deprecation notice.

In general, users who upgrade to WordPress 4.4 won’t notice a difference. However, with nearly a month to go before WordPress 4.4 is released, theme developers are highly encouraged to check and update their themes accordingly.

4

4 responses to “WordPress 4.4 to Deprecate the wp_title Function”

  1. Now, thats a bit of work to do. Probably overriding titles never been a good practice.
    I think Genesis framework use it if add_theme_support( ‘title-tag’ ) is not provided in the theme.

  2. Another reason we’re starting to use other blog/cms systems.

    Too many changes in minor versions. Major versions are for major features… 4.3 was a disaster, not enough (or no) testing breaking tens of thousands of themes.

    Sigh… I think it’s time to move on… we’re breaking up wordpress.

    We’ve already created a wordpress plugin converter for another CMS, and like many others between breaking changes in minor versions and way to many security isssues, this blogging platform is becoming bogus.

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: