WordPress 4.4 will deprecate wp_title()

wordpress

#1

Using wp_title() in WordPress 4.4 will show a deprecated notice (when WP_DEBUG is on).

Theme authors are encouraged to use the new core title generation feature, introduced in WordPress 4.1

Simply add add_theme_support( 'title-tag' ); to your after_setup_theme callback and the <title> tag will be generated within wp_head()

To make themes backward compatible with pre-4.1 this snippet can be added to your functions.php file:

if ( ! function_exists( '_wp_render_title_tag' ) ) :
   function theme_slug_render_title() {
      ?>
      <title><?php wp_title( '-', true, 'right' ); ?></title> 
      <?php
   }
   add_action( 'wp_head', 'theme_slug_render_title' );
endif;

This may change certain SEO plugins as well, or any CodeCanyon plugin that modifies title output (not too sure what title filters are changing).

More details here: https://make.wordpress.org/core/2015/10/20/document-title-in-4-4/


#2

@dtbaker Thanks for the heads up! :smiley: