Opened 8 years ago
Closed 4 years ago
#39049 closed defect (bug) (fixed)
get_pages() docs say function returns list, actually returns array
Reported by: | ovenall | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.6 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | needs-refresh |
Focuses: | docs | Cc: |
Description
This function returns an array of posts, not a list.
Please correct both first paragraph and “Returns” section.
Attachments (1)
Change History (8)
#2
@
8 years ago
- Keywords close added
- Version trunk deleted
Hey there,
Thanks for opening this ticket and welcome to WordPress Trac!
The terms array and list are often used interchangeably in documentation throughout WordPress core. In fact, searching for "a list of" in core returns almost 150 results. The return type clearly says array
and there's no List interface like in Java or many other programming languages that this could be mixed up with. Thus, I do not think that there's much confusion. If it turns out to be very confusing for developers, this should be applied to all relevant sections and not just get_pages()
#3
@
8 years ago
When I hear list, I guess I just think about a ul
or ol
in html. As a relative beginner, I've been tripped up by it in the docs. If I went through and changed all of those and submitted a patch, would that be accepted? Since the PHPdocs are also pushed to the code reference, I think it could be a big help for devs like me. But I obviously defer to your knowledge there.
#5
@
4 years ago
- Component changed from Posts, Post Types to General
- Keywords needs-refresh added; has-patch removed
corrects the wording.