[wp-trac] [WordPress Trac] #12370: We need a smarter version of wp_title() and a few other template tags

WordPress Trac wp-trac at lists.automattic.com
Mon May 3 22:30:23 UTC 2010

#12370: We need a smarter version of wp_title() and a few other template tags
 Reporter:  Viper007Bond  |       Owner:  hallsofmontezuma   
     Type:  defect (bug)  |      Status:  accepted           
 Priority:  normal        |   Milestone:  3.0                
Component:  Template      |     Version:  3.0                
 Severity:  major         |    Keywords:  needs-patch blocker
Changes (by aaroncampbell):

 * cc: aaron@… (added)


 I did some work on this in the plane, and I'll upload a patch once I get
 home, but here are some thing I wanted feedback on:

  1. I added a filter (pre_wp_title) so plugins or themes can set a title
 and skip all the logic in `wp_title()`.  In the case that the filter is
 used, should we still trigger the `wp_title` filter?
  1. Twenty Ten uses | as a separator (and uses doesn't look like it
 properly implements anything for rtl) but specifies no separator (empty
 string) when calling `wp_title()`.  Do we need to build in a second
 separator or just use the one passed to wp_title in all places?
  1. For 404 errors, `wp_title()` uses the string "Page not found" which is
 translated.  Twenty Ten however uses "Not Found" which is translated using
 the twentyten domain.  Should we change to the TwentyTen string or use the
 existing one?
  1. Near the end of the current `wp_title()` (just before the title is
 split on the separator and reversed if RTL), it checks to see if $title is
 empty and sets $prefix.  This is basically used to prepend the separator
 to the title (but never return JUST the separator).  To keep that
 functionality I can just prepend the separator to the title, but that
 seems REALLY funny.  Titles shouldn't BEGIN with a | or ».  I'm all
 for just dropping that and using the separator to go BETWEEN things.

Ticket URL: <http://core.trac.wordpress.org/ticket/12370#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list