#24384 closed defect (bug) (invalid)
get_pages('parent=1') returns nothing
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.5.1 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
get_pages('parent=1') returns an empty array
get_pages('parent=1&hierarchical=0') returns an array of pages
get_pages('parent=0') returns an array of pages
(assuming there is a page with ID=1 and it has children)
It seems like if parent=0 works then parent=1 should also work.
Change History (2)
Note: See
TracTickets for help on using
tickets.
Documentation for that functions is here:
http://codex.wordpress.org/Function_Reference/get_pages
It indicates there are two valid options for the argument 'parent', namely -1 (to return all pages) and 0 (to return top level pages only).
I suspect the function you need is get_children() that will return a passed page ID and all of it's children.