Make WordPress Core


Ignore:
Timestamp:
10/06/2014 03:35:49 PM (12 years ago)
Author:
DrewAPicture
Message:

Add inline documentation for WP_User_Query default arguments in the form of a hash notation.

Adds documentation pointers from the class-level doc for WP_User_Query, as well as the get_users() doc.

Props tschutter.
Fixes #29846.

File:
1 edited

Legend:

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

    r29819 r29843  
    440440 *
    441441 * @since 3.1.0
     442 *
     443 * @see WP_User_Query::prepare_query() for information on accepted arguments.
    442444 */
    443445class WP_User_Query {
     
    496498         *
    497499         * @since 3.1.0
    498          *
    499          * @param string|array $args Optional. The query variables.
     500         * @access public
     501         *
     502         * @param string|array $query {
     503         *     Optional. Array or string of Query parameters.
     504         *
     505         *     @type int          $blog_id         The site ID. Default is the global blog id.
     506         *     @type string       $role            Role name. Default empty.
     507         *     @type string       $meta_key        User meta key. Default empty.
     508         *     @type string       $meta_value      User meta value. Default empty.
     509         *     @type string       $meta_compare    Comparison operator to test the `$meta_value`. Accepts '=', '!=',
     510         *                                         '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN',
     511         *                                         'NOT BETWEEN', 'EXISTS', 'NOT EXISTS', 'REGEXP', 'NOT REGEXP',
     512         *                                         or 'RLIKE'. Default '='.
     513         *     @type array        $include         An array of user IDs to include. Default empty array.
     514         *     @type array        $exclude         An array of user IDs to exclude. Default empty array.
     515         *     @type string       $search          Search keyword. Searches for possible string matches on columns.
     516         *                                         When `$search_columns` is left empty, it tries to determine which
     517         *                                         column to search in based on search string. Default empty.
     518         *     @type array        $search_columns  Array of column names to be searched. Accepts 'ID', 'login',
     519         *                                         'nicename', 'email', 'url'. Default empty array.
     520         *     @type string       $orderby         Field to sort the retrieved users by. Accepts 'ID', 'display_name',
     521         *                                         'login', 'nicename', 'email', 'url', 'registered', 'post_count', or
     522         *                                         'meta_value'. To use 'meta_value', `$meta_key` must be also be defined.
     523         *                                         Default 'user_login'.
     524         *     @type string       $order           Designates ascending or descending order of users. Accepts 'ASC',
     525         *                                         'DESC'. Default 'ASC'.
     526         *     @type int          $offset          Number of users to offset in retrieved results. Can be used in
     527         *                                         conjunction with pagination. Default 0.
     528         *     @type int          $number          Number of users to limit the query for. Can be used in conjunction
     529         *                                         with pagination. Value -1 (all) is not supported.
     530         *                                         Default empty (all users).
     531         *     @type bool         $count_total     Whether to count the total number of users found. If pagination is not
     532         *                                         needed, setting this to false can improve performance. Default true.
     533         *     @type string|array $fields          Which fields to return. Single or all fields (string), or array
     534         *                                         of fields. Accepts 'ID', 'display_name', 'login', 'nicename', 'email',
     535         *                                         'url', 'registered'. Use 'all' for all fields and 'all_with_meta' to
     536         *                                         include meta fields. Default 'all'.
     537         *     @type string       $who             Type of users to query. Accepts 'authors'. Default empty (all users).
     538         * }
    500539         */
    501540        public function prepare_query( $query = array() ) {
     
    925964 * @since 3.1.0
    926965 *
    927  * @uses WP_User_Query See for default arguments and information.
    928  *
    929  * @param array $args Optional. Array of arguments.
     966 * @see WP_User_Query
     967 *
     968 * @param array $args Optional. Arguments to retrieve users. See {@see WP_User_Query::prepare_query()}
     969 *                    for more information on accepted arguments.
    930970 * @return array List of users.
    931971 */
Note: See TracChangeset for help on using the changeset viewer.