Opened 6 years ago
Closed 6 years ago
#50020 closed defect (bug) (fixed)
WP_Theme get_post_templates incorrect @return docblock line?
| Reported by: | salvatore.formisano | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.5 |
| Component: | Themes | Version: | |
| Severity: | trivial | Keywords: | has-patch |
| Cc: | Focuses: | docs |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.