Make WordPress Core

Changeset 30280


Ignore:
Timestamp:
11/08/2014 08:18:50 PM (12 years ago)
Author:
DrewAPicture
Message:

Document default arguments for WP_Comment_Query class as a hash notation.

Props boonebgorges, DrewAPicture.
See #30111.

File:
1 edited

Legend:

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

    r30202 r30280  
    291291         *              'post_author__not_in', 'author__in', 'author__not_in', 'post__in',
    292292         *              'post__not_in', 'include_unapproved', 'type__in', and 'type__not_in'
    293          *              to $query_vars.
    294          *
    295          * @param string|array $query_vars
    296          * @return int|array
     293         *              arguments to $query_vars.
     294         *
     295         * @param string|array $query_vars {
     296         *     Optional. Array or query string of comment query parameters.
     297         *
     298         *     @type string       $author_email        Comment author email address. Default empty.
     299         *     @type array        $author__in          Array of author IDs to include comments for. Default empty.
     300         *     @type array        $author__not_in      Array of author IDs to exclude comments for. Default empty.
     301         *     @type array        $comment__in         Array of comment IDs to include. Default empty.
     302         *     @type array        $comment__not_in     Array of comment IDs to exclude. Default empty.
     303         *     @type bool         $count               Whether to return a comment count (true) or array of comment
     304         *                                             objects (false). Default false.
     305         *     @type array        $date_query          Date query clauses to limit comments by. See {@see WP_Date_Query}.
     306         *                                             Default null.
     307         *     @type string       $fields              Comment fields to return. Accepts 'ids' for comment IDs only or
     308         *                                             empty for all fields. Default empty.
     309         *     @type int          $ID                  Currently unused.
     310         *     @type array        $include_unapproved  Array of IDs or email addresses of users whose unapproved comments
     311         *                                             will be returned by the query regardless of `$status`. Default empty.
     312         *     @type int          $karma               Karma score to retrieve matching comments for. Default empty.
     313         *     @type string       $meta_key            Include comments with a matching comment meta key. Default empty.
     314         *     @type string       $meta_value          Include comments with a matching comment meta value. Requires
     315         *                                             `$meta_key` to be set. Default empty.
     316         *     @type array        $meta_query          Meta query clauses to limit retrieved comments by.
     317         *                                             See {@see WP_Meta_Query}. Default empty.
     318         *     @type int          $number              Maximum number of comments to retrieve. Default null (no limit).
     319         *     @type int          $offset              Number of comments to offset the query. Used to build LIMIT clause.
     320         *                                             Default 0.
     321         *     @type string|array $orderby             Comment status or array of statuses. Accepts 'comment_agent',
     322         *                                             'comment_approved', 'comment_author', 'comment_author_email',
     323         *                                             'comment_author_IP', 'comment_author_url', 'comment_content',
     324         *                                             'comment_date', 'comment_date_gmt', 'comment_ID', 'comment_karma',
     325         *                                             'comment_parent', 'comment_post_ID', 'comment_type', 'user_id',
     326         *                                             'meta_value', 'meta_value_num', or value of $meta_key.
     327         *                                              Also accepts false, empty array, or 'none' to disable `ORDER BY`
     328         *                                             clause. Default: 'comment_date_gmt'.
     329         *     @type string       $order               How to order retrieved comments. Accepts 'ASC', 'DESC'.
     330         *                                             Default: 'DESC'.
     331         *     @type int          $parent              Parent ID of comment to retrieve children of. Default empty.
     332         *     @type array        $post_author__in     Array of author IDs to retrieve comments for. Default empty.
     333         *     @type array        $post_author__not_in Array of author IDs *not* to retrieve comments for. Default empty.
     334         *     @type int          $post_ID             Currently unused.
     335         *     @type int          $post_id             Limit results to those affiliated with a given post ID. Default 0.
     336         *     @type array        $post__in            Array of post IDs to include affiliated comments for. Default empty.
     337         *     @type array        $post__not_in        Array of post IDs to exclude affiliated comments for. Default empty.
     338         *     @type int          $post_author         Comment author ID to limit results by. Default empty.
     339         *     @type string       $post_status         Post status to retrieve affiliated comments for. Default empty.
     340         *     @type string       $post_type           Post type to retrieve affiliated comments for. Default empty.
     341         *     @type string       $post_name           Post name to retrieve affiliated comments for. Default empty.
     342         *     @type int          $post_parent         Post parent ID to retrieve affiliated comments for. Default empty.
     343         *     @type string       $search              Search term(s) to retrieve matching comments for. Default empty.
     344         *     @type string       $status              Comment status to limit results by. Accepts 'hold'
     345         *                                             (`comment_status=0`), 'approve' (`comment_status=1`), 'all', or a
     346         *                                             custom comment status. Default 'all'.
     347         *     @type string|array $type                Include comments of a given type, or array of types. Accepts
     348         *                                             'comment', 'pings' (includes 'pingback' and 'trackback'), or any
     349         *                                             custom type string. Default empty.
     350         *     @type array        $type__in            Include comments from a given array of comment types. Default empty.
     351         *     @type array        $type__not_in        Exclude comments from a given array of comment types. Default empty.
     352         *     @type int          $user_id             Include comments for a specific user ID. Default empty.
     353         * }
     354         * @return int|array Array of comments or number of found comments if `$count` is set to true.
    297355         */
    298356        public function query( $query_vars ) {
Note: See TracChangeset for help on using the changeset viewer.