591 | | * Retrieve all children of the post parent ID. |
592 | | * |
593 | | * Normally, without any enhancements, the children would apply to pages. In the |
594 | | * context of the inner workings of WordPress, pages, posts, and attachments |
595 | | * share the same table, so therefore the functionality could apply to any one |
596 | | * of them. It is then noted that while this function does not work on posts, it |
597 | | * does not mean that it won't work on posts. It is recommended that you know |
598 | | * what context you wish to retrieve the children of. |
599 | | * |
600 | | * Attachments may also be made the child of a post, so if that is an accurate |
601 | | * statement (which needs to be verified), it would then be possible to get |
602 | | * all of the attachments for a post. Attachments have since changed since |
603 | | * version 2.5, so this is most likely inaccurate, but serves generally as an |
604 | | * example of what is possible. |
605 | | * |
606 | | * The arguments listed as defaults are for this function and also of the |
607 | | * get_posts() function. The arguments are combined with the get_children defaults |
608 | | * and are then passed to the get_posts() function, which accepts additional arguments. |
609 | | * You can replace the defaults in this function, listed below and the additional |
610 | | * arguments listed in the get_posts() function. |
611 | | * |
612 | | * The 'post_parent' is the most important argument and important attention |
613 | | * needs to be paid to the $args parameter. If you pass either an object or an |
614 | | * integer (number), then just the 'post_parent' is grabbed and everything else |
615 | | * is lost. If you don't specify any arguments, then it is assumed that you are |
616 | | * in The Loop and the post parent will be grabbed for from the current post. |
617 | | * |
618 | | * The 'post_parent' argument is the ID to get the children. The 'numberposts' |
619 | | * is the amount of posts to retrieve that has a default of '-1', which is |
620 | | * used to get all of the posts. Giving a number higher than 0 will only |
621 | | * retrieve that amount of posts. |
622 | | * |
623 | | * The 'post_type' and 'post_status' arguments can be used to choose what |
624 | | * criteria of posts to retrieve. The 'post_type' can be anything, but WordPress |
625 | | * post types are 'post', 'pages', and 'attachments'. The 'post_status' |
626 | | * argument will accept any post status within the write administration panels. |
| 591 | * Retrieve all children of a page or any other hierarchical post type. |
| 592 | * |
| 593 | * By default, the children of the parent of the global `$post` are retrieved. |
| 594 | * Note that `$post` is either the current post in The Loop or the post/page being |
| 595 | * displayed. This function only works for hierarchical post types such as pages. |
| 596 | * |
| 597 | * Only children are returned, excluding "grandchildren". |