[wp-trac] [WordPress Trac] #40969: RFE: get_template_part() to return something or warn when nothing found

WordPress Trac noreply at wordpress.org
Sun Jun 28 23:09:14 UTC 2020


#40969: RFE: get_template_part() to return something or warn when nothing found
-------------------------------------------------+-------------------------
 Reporter:  sphakka                              |       Owner:
                                                 |  williampatton
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  5.5
Component:  Themes                               |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch dev-feedback needs-dev-    |     Focuses:  template
  note early has-unit-tests needs-testing        |
-------------------------------------------------+-------------------------
Changes (by SergeyBiryukov):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"48209" 48209]:
 {{{
 #!CommitTicketReference repository="" revision="48209"
 Themes: Add a return value to theme functions calling `locate_template()`:

 * `get_header()`
 * `get_footer()`
 * `get_sidebar()`
 * `get_template_part()`

 These functions now return false if the template file could not be found,
 to allow for easier debugging.

 Props tferry, sphakka, johnbillion, pento, davidbinda, desrosj, birgire,
 garrett-eclipse, williampatton, davidbaumwald, SergeyBiryukov.
 Fixes #40969.
 }}}

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


More information about the wp-trac mailing list