[wp-trac] [WordPress Trac] #18548: Add a better option for <title> tags

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 26 23:43:18 UTC 2011


#18548: Add a better option for <title> tags
------------------------------------------------+--------------------------
 Reporter:  joostdevalk                         |       Owner:  joostdevalk
     Type:  enhancement                         |      Status:  new
 Priority:  normal                              |   Milestone:  Awaiting
Component:  Template                            |  Review
 Severity:  normal                              |     Version:  3.3
 Keywords:  has-patch dev-feedback needs-codex  |  Resolution:
------------------------------------------------+--------------------------

Comment (by nacin):

 > So, is it really preferable to introduce 200 lines of code, a new
 template tag, and a new add_theme_support() call, instead of simply
 educating Theme developers on the best practice for modifying doctitle
 content?

 Yes. This isn't a new template tag.

 The 200 lines of code are copy-pasted from the current wp_title(), and
 improved for context and performance. In many cases these are backwards
 incompatible changes, mostly outlined in previous comments.

 wp_title() will be deprecated in a future release, probably when core
 supports a UI for title tag manipulation. (See comments from jane above.)

 > The past of least resistance (and fastest adoption) is going to be to
 say, "move your wp_title()-filtering code out of header.php, wrap it in a
 function in functions.php, and hook it into add_filter( 'wp_title',
 'themename_filter_wp_title' )".

 I disagree on both counts. This path is more work, without a doubt. Some
 of them might not even know what a filter is or how it works.

 The new instructions would be: No more template tag, no more wp_title(),
 no more messy code in between your <title> tags. Just use
 `add_theme_support('title-tag');` and you're done. It's pretty much idiot
 proof, and that's the idea.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18548#comment:73>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list