[wp-trac] [WordPress Trac] #24384: get_pages('parent=1') returns nothing

WordPress Trac noreply at wordpress.org
Wed May 22 19:40:36 UTC 2013


#24384: get_pages('parent=1') returns nothing
--------------------------+------------------------------
 Reporter:  tomdxw        |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.5.1
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |
--------------------------+------------------------------
Changes (by MattyRob):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 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.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24384#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list