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

WordPress Trac noreply at wordpress.org
Mon Feb 18 08:39:29 UTC 2019


#40969: RFE: get_template_part() to return something or warn when nothing found
-----------------------------------------+-----------------------
 Reporter:  sphakka                      |       Owner:  pento
     Type:  enhancement                  |      Status:  reopened
 Priority:  normal                       |   Milestone:  5.2
Component:  Themes                       |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  close has-patch 2nd-opinion  |     Focuses:  template
-----------------------------------------+-----------------------

Comment (by birgire):

 Thanks for the patch @tferry

 Few suggestions regarding the inline documentation in
 [attachment:"40969.4.diff"]:

 - Add the missing {{{@return}}} part.
 - Add the {{{null}}} type.
 - Mention the default name value.
 - Mention that the name is optional.

 So instead of this part:

 {{{
 * @param string $slug The slug name for the generic template.
 * @param string $name The name of the specialised template.
 }}}

 it could be:

 {{{
 * @param string      $slug The slug name for the generic template.
 * @param string|null $name Optional. The name of the specialised template.
 Default null.
 *
 * @return bool Whether the template part exists.
 }}}

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


More information about the wp-trac mailing list