[wp-trac] [WordPress Trac] #21213: Underscores get stripped out in $type ( get_query_template() )

WordPress Trac noreply at wordpress.org
Wed Apr 16 20:14:39 UTC 2014


#21213: Underscores get stripped out in $type ( get_query_template() )
-------------------------------------+-----------------------------
 Reporter:  rinatkhaziev             |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Future Release
Component:  Themes                   |     Version:  2.5
 Severity:  normal                   |  Resolution:
 Keywords:  needs-testing has-patch  |     Focuses:  template
-------------------------------------+-----------------------------

Comment (by chipbennett):

 I was just about to write a patch for this. The RegEx is clearly
 inconsistent with the intent of `get_front_page_template()`:
 {{{
 function get_front_page_template() {
         $templates = array('front-page.php');

         return get_query_template( 'front_page', $templates );
 }
 }}}

 What is the point of passing `front_page` as `$type`, if the underscore
 gets stripped? Either pass `frontpage` instead of `front_page`, or fix the
 RegEx.

 This is very confusing for Theme developers.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/21213#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list