Make WordPress Core


Ignore:
Timestamp:
07/11/2014 11:33:33 PM (10 years ago)
Author:
DrewAPicture
Message:

Convert default arguments documentation for get_posts() into a hash notation.

Props coffee2code for the initial patch.
See #28841.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r29097 r29113  
    15891589 *
    15901590 * Accepted keys of the label array in the post type object:
     1591 *
    15911592 * - name - general name for the post type, usually plural. The same and overridden
    15921593 *          by $post_type_object->label. Default is Posts/Pages
     
    18111812 *
    18121813 * The defaults are as follows:
    1813  *     'numberposts' - Default is 5. Total number of posts to retrieve.
    1814  *     'offset' - Default is 0. See {@link WP_Query::query()} for more.
    1815  *     'category' - What category to pull the posts from.
    1816  *     'orderby' - Default is 'date', which orders based on post_date. How to order the posts.
    1817  *     'order' - Default is 'DESC'. The order to retrieve the posts.
    1818  *     'include' - See {@link WP_Query::query()} for more.
    1819  *     'exclude' - See {@link WP_Query::query()} for more.
    1820  *     'meta_key' - See {@link WP_Query::query()} for more.
    1821  *     'meta_value' - See {@link WP_Query::query()} for more.
    1822  *     'post_type' - Default is 'post'. Can be 'page', or 'attachment' to name a few.
    1823  *     'post_parent' - The parent of the post or post type.
    1824  *     'post_status' - Default is 'publish'. Post status to retrieve.
    18251814 *
    18261815 * @since 1.2.0
    18271816 *
    1828  * @todo Tie to WP_Query default args hash notation.
    1829  *
    1830  * @see WP_Query::query()
    1831  *
    1832  * @param array $args Optional. Overrides defaults.
     1817 * @see WP_Query::parse_query()
     1818 *
     1819 * @param array $args {
     1820 *     Optional. Arguments to retrieve posts. {@see WP_Query::parse_query()} for more
     1821 *     available arguments.
     1822 *
     1823 *     @type int        $numberposts      Total number of posts to retrieve. Is an alias of $posts_per_page
     1824 *                                        in WP_Query. Accepts 1+ and -1 for all. Default 5.
     1825 *     @type int        $offset           The number of posts to offset before retrieval. Default 0.
     1826 *     @type int|string $category         Category ID or comma-separated list of IDs (this or any children).
     1827 *                                        Is an alias of $cat in WP_Query. Default 0.
     1828 *     @type string     $orderby          Which field to order posts by. Accepts post fields. Default 'date'.
     1829 *     @type array      $include          An array of post IDs to retrieve, sticky posts will be included.
     1830 *                                        Is an alias of $post__in in WP_Query. Default empty array.
     1831 *     @type array      $exclude          An array of post IDs not to retrieve. Default empty array.
     1832 *     @type string     $meta_key         Custom field key. Default empty.
     1833 *     @type mixed      $meta_value       Custom field value. Default empty string.
     1834 *     @type string     $post_type        Post type. Default 'post'.
     1835 *     @type bool       $suppress_filters Whether to suppress filters. Default true.
     1836 * }
    18331837 * @return array List of posts.
    18341838 */
Note: See TracChangeset for help on using the changeset viewer.