[wp-trac] [WordPress Trac] #50020: WP_Theme get_post_templates incorrect @return docblock line?

WordPress Trac noreply at wordpress.org
Mon Apr 27 21:41:20 UTC 2020


#50020: WP_Theme get_post_templates incorrect @return docblock line?
---------------------------------+-----------------------------
 Reporter:  salvatore.formisano  |      Owner:  (none)
     Type:  defect (bug)         |     Status:  new
 Priority:  normal               |  Milestone:  Awaiting Review
Component:  Themes               |    Version:
 Severity:  trivial              |   Keywords:
  Focuses:  docs                 |
---------------------------------+-----------------------------
 As per title, the `get_post_templates` method of the `WP_Theme` class
 seems to have an incorrect `@return` docblock value. The `@return` type is
 set to `string`, but the method returns an array of the templates, and
 even the @return description literally says `Array of page templates,
 keyed by filename and post type`.

 You can see this on line 1190 of `class-wp-theme.php`.

 I noticed this because a plugin I am building calls this method and the
 IDE gave me a squiggly line when I worked with the method's output
 assuming it's an array.

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


More information about the wp-trac mailing list