Themes: Improve document title output.

Introduces more flexibility in filtering all parts of the document title,the
separator, and a way to short-circuit title generation. Plugins can now also
check for theme support and reliably filter the entire output. See #18548.
Deprecates `wp_title()`.

Fixes #31078.



git-svn-id: https://develop.svn.wordpress.org/trunk@35294 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Konstantin Obenland
2015-10-20 16:20:04 +00:00
parent 1940317385
commit d625bd2428
12 changed files with 557 additions and 229 deletions

View File

@@ -1752,14 +1752,6 @@ function current_theme_supports( $feature ) {
if ( !isset( $_wp_theme_features[$feature] ) )
return false;
if ( 'title-tag' == $feature ) {
// Don't confirm support unless called internally.
$trace = debug_backtrace();
if ( ! in_array( $trace[1]['function'], array( '_wp_render_title_tag', 'wp_title' ) ) ) {
return false;
}
}
// If no args passed then no extra checks need be performed
if ( func_num_args() <= 1 )
return true;