Opened 2 years ago
Closed 2 years ago
#56330 closed defect (bug) (fixed)
When does get_pages() return an array of ints?
Reported by: | malthert | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | trivial | Version: | |
Component: | Query | Keywords: | good-first-bug has-patch |
Focuses: | docs | Cc: |
Description
@return WP_Post[]|int[]|false
But afaik I always get WP_Post[]|false ? What do I need to do to get int[] ?
Attachments (2)
Change History (11)
#3
@
2 years ago
just to clarify: I don't actually want to get int[], I just think the @return is wrong and want it corrected.
#4
@
2 years ago
- Focuses docs added
- Keywords needs-patch good-first-bug added
Confirmed, this should be WP_Post[]|false
. Thanks for the report.
#5
@
2 years ago
- Owner set to audrasjb
- Status changed from new to accepted
Great, thank for the confirmation! 👌
#7
@
2 years ago
- Keywords needs-refresh added
Thank you for the patch @jigar-bhanushali.
However, I have two small remarks:
- We use the
good-first-bug
keyword as an invitation for new people who never contributed to WordPress Core before. It's better to keep it for new contributors. - Your patch doesn't meet WordPress Coding Standards as the indentation of the docblock needs to be updated accordingly :)
Note: See
TracTickets for help on using
tickets.
Indeed I can't see any way to retrieve an array of integers.
This return type mention was introduced in [49790] / #51800.