Opened 6 years ago
Closed 6 years ago
#50020 closed defect (bug) (fixed)
WP_Theme get_post_templates incorrect @return docblock line?
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.5 | Priority: | normal |
| Severity: | trivial | Version: | |
| Component: | Themes | Keywords: | has-patch |
| Focuses: | docs | Cc: |
Description
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.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Hi there, welcome to WordPress Trac! Thanks for the report.
Good catch, this appears to be a typo in [46661], which intended to switch the
arrayto a more specificstring[], but accidentally usedstringinstead.