Make WordPress Core

Ticket #52888: 52888.diff

File 52888.diff, 3.5 KB (added by ribaricplusplus, 4 years ago)
  • src/wp-includes/post.php

    diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
    index b17f254653..1a30456d49 100644
    a b function _wp_relative_upload_path( $path ) { 
    588588}
    589589
    590590/**
    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".
    627598 *
    628599 * @since 2.0.0
    629600 *
    630601 * @see get_posts()
    631  * @todo Check validity of description.
    632602 *
    633603 * @global WP_Post $post Global post object.
    634604 *
    635  * @param mixed  $args   Optional. User defined arguments for replacing the defaults. Default empty.
     605 * @param mixed  $args   Optional. Parent ID (integer), or an array with arguments to be
     606 *                       passed to `get_posts`. When using an array, pass in the `post_parent`
     607 *                       field to determine whose children are retrieved. Default empty
    636608 * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
    637609 *                       correspond to a WP_Post object, an associative array, or a numeric array,
    638610 *                       respectively. Default OBJECT.