[wp-trac] [WordPress Trac] #23470: Convert slash to dash and make body class for page templates look better

WordPress Trac noreply at wordpress.org
Wed Feb 13 12:24:10 UTC 2013


#23470: Convert slash to dash and make body class for page templates look better
-----------------------------+--------------------------
 Reporter:  Caspie           |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Template
  Version:  3.5.1            |   Severity:  normal
 Keywords:  has-patch        |
-----------------------------+--------------------------
 If you keep you page templates in a page-templates folder in your theme.
 Let's we have a template named front-page.php - the template slug written
 in the postmeta will be '''page-templates/front-page.php'''

 When generating the classes for the body, get_body_class() will convert
 the dot to a dash but the slash will be stripped by sanitize_html_class().
 So finally we will have a class:

 '''page-template-page-templatesfront-page-php'''

 Isn't it prettier to convert the slash to dash and to have it like:

 '''page-template-page-templates-front-page-php'''

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23470>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list