[wp-trac] [WordPress Trac] #11609: body_class and post_class bug with duplicate .page class possibility

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 25 21:24:41 UTC 2009


#11609: body_class and post_class bug with duplicate .page class possibility
-------------------------+--------------------------------------------------
 Reporter:  Frumph       |        Owner:          
     Type:  enhancement  |       Status:  reopened
 Priority:  normal       |    Milestone:  3.0     
Component:  Themes       |      Version:          
 Severity:  normal       |   Resolution:          
 Keywords:  2nd-opinion  |  
-------------------------+--------------------------------------------------
Changes (by nacin):

  * keywords:  => 2nd-opinion
  * status:  closed => reopened
  * resolution:  wontfix =>
  * milestone:  => 3.0


Comment:

 It looks like .page is the only duplicated class among body_class and
 post_class. I understand that makes it slightly more difficult for a theme
 developer to write CSS.

 Defrecerencing? How difficult, really, is div.page? Or whatever other
 element you're using post_class on? Feel free to do whatever you'd like
 with a filter, but element specificity in CSS is hardly a hack. You should
 never rely on a class's uniqueness (especially one inserted by a CMS) --
 that's why it's a class and not an id.

 That said, with expanded custom post type support in 2.9 and 3.0, I think
 it would be a good idea to consider adding a post-type-{type} class, but
 not replacing the current {type} class. While it will duplicate the
 existing class, I can see how it can be helpful, given so many
 possibilities for overlap with custom post type names and other classes
 that may be used in a theme or by a widget. (Which, again, reminds us of
 why specificity is important.)

 I'm okay with a wontfix, but I think we should re-open this and allow a
 core developer to view the second patch and make a determination first.

 We have to be very careful in core not to cause backward compatability
 problems with themes and the various template tags. Very careful. (Plugins
 are a separate beast as they deal with hooks, APIs, and functionality, and
 are often developed by people with more of a programming background -- or
 any background at all -- than we see with themes.)

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


More information about the wp-trac mailing list