[wp-trac] [WordPress Trac] #32989: The inline documentation on the filters commentspopup_template and frontpage_template

WordPress Trac noreply at wordpress.org
Tue Jul 14 08:47:48 UTC 2015


#32989: The inline documentation on the filters commentspopup_template and
frontpage_template
----------------------------+-----------------------------
 Reporter:  birgire         |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Themes          |    Version:  4.2.2
 Severity:  normal          |   Keywords:
  Focuses:  docs, template  |
----------------------------+-----------------------------
 In the file:

 https://github.com/WordPress/WordPress/blob/43077a6ef8d58b7d6dfb7ab1e2560a0186e60c09
 /wp-includes/template.php#L450

 we got this description:

 > The template path is filterable via the 'comments_popup_template' hook.

 but that's not correct since the underscore is removed in the
 `get_query_template()` function:

 {{{
 $type = preg_replace( '|[^a-z0-9-]+|', '', $type );
 }}}

 where the type `comments-popup` is modified to `commentspopup`.

 The correct filter is therefore `commentspopup_template` and the
 documentation should read:

 > The template path is filterable via the 'commentspopup_template' hook.

 Similarly in the file:

 https://github.com/WordPress/WordPress/blob/43077a6ef8d58b7d6dfb7ab1e2560a0186e60c09
 /wp-includes/template.php#L278-279

 the description:

 > Looks for 'front-page.php'. The template path is filterable via the
 'front_page_template' hook.

 should be:

 > Looks for 'front-page.php'. The template path is filterable via the
 'frontpage_template' hook.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32989>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list