mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-17 20:15:08 +00:00
Query: Correct and standardise the meta query documentation.
Also improves the formatting of some surrounding documentation. Props audrasjb, johnbillion Fixes #53467 Built from https://develop.svn.wordpress.org/trunk@52226 git-svn-id: http://core.svn.wordpress.org/trunk@51818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1bd5af61d2
commit
fa62df0774
@ -141,6 +141,8 @@ class WP_Comment_Query {
|
||||
* @since 4.5.0 Introduced the `$author_url` argument.
|
||||
* @since 4.6.0 Introduced the `$cache_domain` argument.
|
||||
* @since 4.9.0 Introduced the `$paged` argument.
|
||||
* @since 5.1.0 Introduced the `$meta_compare_key` argument.
|
||||
* @since 5.3.0 Introduced the `$meta_type_key` argument.
|
||||
*
|
||||
* @param string|array $query {
|
||||
* Optional. Array or query string of comment query parameters. Default empty.
|
||||
@ -163,16 +165,22 @@ class WP_Comment_Query {
|
||||
* `$status`. Default empty.
|
||||
* @type int $karma Karma score to retrieve matching comments for.
|
||||
* Default empty.
|
||||
* @type string $meta_key Include comments with a matching comment meta key.
|
||||
* Default empty.
|
||||
* @type string $meta_value Include comments with a matching comment meta value.
|
||||
* Requires `$meta_key` to be set. Default empty.
|
||||
* @type array $meta_query Meta query clauses to limit retrieved comments by.
|
||||
* See WP_Meta_Query. Default empty.
|
||||
* @type string|string[] $meta_key Meta key or keys to filter by.
|
||||
* @type string|string[] $meta_value Meta value or values to filter by.
|
||||
* @type string $meta_compare MySQL operator used for comparing the meta value.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_compare_key MySQL operator used for comparing the meta key.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_type MySQL data type that the meta_value column will be CAST to for comparisons.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_type_key MySQL data type that the meta_key column will be CAST to for comparisons.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type array $meta_query An associative array of WP_Meta_Query arguments.
|
||||
* See WP_Meta_Query::__construct for accepted values.
|
||||
* @type int $number Maximum number of comments to retrieve.
|
||||
* Default empty (no limit).
|
||||
* @type int $paged When used with $number, defines the page of results to return.
|
||||
* When used with $offset, $offset takes precedence. Default 1.
|
||||
* @type int $paged When used with `$number`, defines the page of results to return.
|
||||
* When used with `$offset`, `$offset` takes precedence. Default 1.
|
||||
* @type int $offset Number of comments to offset the query. Used to build
|
||||
* LIMIT clause. Default 0.
|
||||
* @type bool $no_found_rows Whether to disable the `SQL_CALC_FOUND_ROWS` query.
|
||||
@ -180,16 +188,28 @@ class WP_Comment_Query {
|
||||
* @type string|array $orderby Comment status or array of statuses. To use 'meta_value'
|
||||
* or 'meta_value_num', `$meta_key` must also be defined.
|
||||
* To sort by a specific `$meta_query` clause, use that
|
||||
* clause's array key. Accepts 'comment_agent',
|
||||
* 'comment_approved', 'comment_author',
|
||||
* 'comment_author_email', 'comment_author_IP',
|
||||
* 'comment_author_url', 'comment_content', 'comment_date',
|
||||
* 'comment_date_gmt', 'comment_ID', 'comment_karma',
|
||||
* 'comment_parent', 'comment_post_ID', 'comment_type',
|
||||
* 'user_id', 'comment__in', 'meta_value', 'meta_value_num',
|
||||
* the value of $meta_key, and the array keys of
|
||||
* `$meta_query`. Also accepts false, an empty array, or
|
||||
* 'none' to disable `ORDER BY` clause.
|
||||
* clause's array key. Accepts:
|
||||
* - 'comment_agent'
|
||||
* - 'comment_approved'
|
||||
* - 'comment_author'
|
||||
* - 'comment_author_email'
|
||||
* - 'comment_author_IP'
|
||||
* - 'comment_author_url'
|
||||
* - 'comment_content'
|
||||
* - 'comment_date'
|
||||
* - 'comment_date_gmt'
|
||||
* - 'comment_ID'
|
||||
* - 'comment_karma'
|
||||
* - 'comment_parent'
|
||||
* - 'comment_post_ID'
|
||||
* - 'comment_type'
|
||||
* - 'user_id'
|
||||
* - 'comment__in'
|
||||
* - 'meta_value'
|
||||
* - 'meta_value_num'
|
||||
* - The value of `$meta_key`
|
||||
* - The array keys of `$meta_query`
|
||||
* - false, an empty array, or 'none' to disable `ORDER BY` clause.
|
||||
* Default: 'comment_date_gmt'.
|
||||
* @type string $order How to order retrieved comments. Accepts 'ASC', 'DESC'.
|
||||
* Default: 'DESC'.
|
||||
|
@ -99,36 +99,67 @@ class WP_Meta_Query {
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @since 4.2.0 Introduced support for naming query clauses by associative array keys.
|
||||
* @since 5.1.0 Introduced $compare_key clause parameter, which enables LIKE key matches.
|
||||
* @since 5.3.0 Increased the number of operators available to $compare_key. Introduced $type_key,
|
||||
* which enables the $key to be cast to a new data type for comparisons.
|
||||
* @since 5.1.0 Introduced `$compare_key` clause parameter, which enables LIKE key matches.
|
||||
* @since 5.3.0 Increased the number of operators available to `$compare_key`. Introduced `$type_key`,
|
||||
* which enables the `$key` to be cast to a new data type for comparisons.
|
||||
*
|
||||
* @param array $meta_query {
|
||||
* Array of meta query clauses. When first-order clauses or sub-clauses use strings as
|
||||
* their array keys, they may be referenced in the 'orderby' parameter of the parent query.
|
||||
*
|
||||
* @type string $relation Optional. The MySQL keyword used to join
|
||||
* the clauses of the query. Accepts 'AND', or 'OR'. Default 'AND'.
|
||||
* @type string $relation Optional. The MySQL keyword used to join the clauses of the query.
|
||||
* Accepts 'AND' or 'OR'. Default 'AND'.
|
||||
* @type array ...$0 {
|
||||
* Optional. An array of first-order clause parameters, or another fully-formed meta query.
|
||||
*
|
||||
* @type string $key Meta key to filter by.
|
||||
* @type string $compare_key MySQL operator used for comparing the $key. Accepts '=', '!='
|
||||
* 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'REGEXP', 'NOT REGEXP', 'RLIKE',
|
||||
* 'EXISTS' (alias of '=') or 'NOT EXISTS' (alias of '!=').
|
||||
* @type string|string[] $key Meta key or keys to filter by.
|
||||
* @type string $compare_key MySQL operator used for comparing the $key. Accepts:
|
||||
* - '='
|
||||
* - '!='
|
||||
* - 'LIKE'
|
||||
* - 'NOT LIKE'
|
||||
* - 'IN'
|
||||
* - 'NOT IN'
|
||||
* - 'REGEXP'
|
||||
* - 'NOT REGEXP'
|
||||
* - 'RLIKE',
|
||||
* - 'EXISTS' (alias of '=')
|
||||
* - 'NOT EXISTS' (alias of '!=')
|
||||
* Default is 'IN' when `$key` is an array, '=' otherwise.
|
||||
* @type string $type_key MySQL data type that the meta_key column will be CAST to for
|
||||
* comparisons. Accepts 'BINARY' for case-sensitive regular expression
|
||||
* comparisons. Default is ''.
|
||||
* @type string $value Meta value to filter by.
|
||||
* @type string $compare MySQL operator used for comparing the $value. Accepts '=',
|
||||
* '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE',
|
||||
* 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN', 'REGEXP',
|
||||
* 'NOT REGEXP', 'RLIKE', 'EXISTS' or 'NOT EXISTS'.
|
||||
* @type string|string[] $value Meta value or values to filter by.
|
||||
* @type string $compare MySQL operator used for comparing the $value. Accepts:
|
||||
* - '=',
|
||||
* - '!='
|
||||
* - '>'
|
||||
* - '>='
|
||||
* - '<'
|
||||
* - '<='
|
||||
* - 'LIKE'
|
||||
* - 'NOT LIKE'
|
||||
* - 'IN'
|
||||
* - 'NOT IN'
|
||||
* - 'BETWEEN'
|
||||
* - 'NOT BETWEEN'
|
||||
* - 'REGEXP'
|
||||
* - 'NOT REGEXP'
|
||||
* - 'RLIKE'
|
||||
* - 'EXISTS'
|
||||
* - 'NOT EXISTS'
|
||||
* Default is 'IN' when `$value` is an array, '=' otherwise.
|
||||
* @type string $type MySQL data type that the meta_value column will be CAST to for
|
||||
* comparisons. Accepts 'NUMERIC', 'BINARY', 'CHAR', 'DATE',
|
||||
* 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', or 'UNSIGNED'.
|
||||
* comparisons. Accepts:
|
||||
* - 'NUMERIC'
|
||||
* - 'BINARY'
|
||||
* - 'CHAR'
|
||||
* - 'DATE'
|
||||
* - 'DATETIME'
|
||||
* - 'DECIMAL'
|
||||
* - 'SIGNED'
|
||||
* - 'TIME'
|
||||
* - 'UNSIGNED'
|
||||
* Default is 'CHAR'.
|
||||
* }
|
||||
* }
|
||||
|
@ -664,13 +664,18 @@ class WP_Query {
|
||||
* Default false.
|
||||
* @type int $m Combination YearMonth. Accepts any four-digit year and month
|
||||
* numbers 1-12. Default empty.
|
||||
* @type string $meta_compare Comparison operator to test the 'meta_value'.
|
||||
* @type string $meta_compare_key Comparison operator to test the 'meta_key'.
|
||||
* @type string $meta_key Custom field key.
|
||||
* @type array $meta_query An associative array of WP_Meta_Query arguments. See WP_Meta_Query.
|
||||
* @type string $meta_value Custom field value.
|
||||
* @type int $meta_value_num Custom field value number.
|
||||
* @type string $meta_type_key Cast for 'meta_key'. See WP_Meta_Query::construct().
|
||||
* @type string|string[] $meta_key Meta key or keys to filter by.
|
||||
* @type string|string[] $meta_value Meta value or values to filter by.
|
||||
* @type string $meta_compare MySQL operator used for comparing the meta value.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_compare_key MySQL operator used for comparing the meta key.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_type MySQL data type that the meta_value column will be CAST to for comparisons.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_type_key MySQL data type that the meta_key column will be CAST to for comparisons.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type array $meta_query An associative array of WP_Meta_Query arguments.
|
||||
* See WP_Meta_Query::__construct for accepted values.
|
||||
* @type int $menu_order The menu order of the posts.
|
||||
* @type int $minute Minute of the hour. Default empty. Accepts numbers 0-59.
|
||||
* @type int $monthnum The two-digit month. Default empty. Accepts numbers 1-12.
|
||||
@ -681,17 +686,31 @@ class WP_Query {
|
||||
* @type int $offset The number of posts to offset before retrieval.
|
||||
* @type string $order Designates ascending or descending order of posts. Default 'DESC'.
|
||||
* Accepts 'ASC', 'DESC'.
|
||||
* @type string|array $orderby Sort retrieved posts by parameter. One or more options may be
|
||||
* passed. To use 'meta_value', or 'meta_value_num',
|
||||
* 'meta_key=keyname' must be also be defined. To sort by a
|
||||
* specific `$meta_query` clause, use that clause's array key.
|
||||
* Accepts 'none', 'name', 'author', 'date', 'title',
|
||||
* 'modified', 'menu_order', 'parent', 'ID', 'rand',
|
||||
* 'relevance', 'RAND(x)' (where 'x' is an integer seed value),
|
||||
* 'comment_count', 'meta_value', 'meta_value_num', 'post__in',
|
||||
* 'post_name__in', 'post_parent__in', and the array keys
|
||||
* of `$meta_query`. Default is 'date', except when a search
|
||||
* is being performed, when the default is 'relevance'.
|
||||
* @type string|array $orderby Sort retrieved posts by parameter. One or more options may be passed.
|
||||
* To use 'meta_value', or 'meta_value_num', 'meta_key=keyname' must be
|
||||
* also be defined. To sort by a specific `$meta_query` clause, use that
|
||||
* clause's array key. Accepts:
|
||||
* - 'none'
|
||||
* - 'name'
|
||||
* - 'author'
|
||||
* - 'date'
|
||||
* - 'title'
|
||||
* - 'modified'
|
||||
* - 'menu_order'
|
||||
* - 'parent'
|
||||
* - 'ID'
|
||||
* - 'rand'
|
||||
* - 'relevance'
|
||||
* - 'RAND(x)' (where 'x' is an integer seed value)
|
||||
* - 'comment_count'
|
||||
* - 'meta_value'
|
||||
* - 'meta_value_num'
|
||||
* - 'post__in'
|
||||
* - 'post_name__in'
|
||||
* - 'post_parent__in'
|
||||
* - The array keys of `$meta_query`.
|
||||
* Default is 'date', except when a search is being performed, when
|
||||
* the default is 'relevance'.
|
||||
* @type int $p Post ID.
|
||||
* @type int $page Show the number of posts that would show up on page X of a
|
||||
* static front page.
|
||||
|
@ -109,7 +109,8 @@ class WP_Site_Query {
|
||||
* @since 4.6.0
|
||||
* @since 4.8.0 Introduced the 'lang_id', 'lang__in', and 'lang__not_in' parameters.
|
||||
* @since 5.1.0 Introduced the 'update_site_meta_cache', 'meta_query', 'meta_key',
|
||||
* 'meta_value', 'meta_type' and 'meta_compare' parameters.
|
||||
* 'meta_compare_key', 'meta_value', 'meta_type', and 'meta_compare' parameters.
|
||||
* @since 5.3.0 Introduced the 'meta_type_key' parameter.
|
||||
*
|
||||
* @param string|array $query {
|
||||
* Optional. Array or query string of site query parameters. Default empty.
|
||||
@ -127,10 +128,18 @@ class WP_Site_Query {
|
||||
* @type int $offset Number of sites to offset the query. Used to build LIMIT clause.
|
||||
* Default 0.
|
||||
* @type bool $no_found_rows Whether to disable the `SQL_CALC_FOUND_ROWS` query. Default true.
|
||||
* @type string|array $orderby Site status or array of statuses. Accepts 'id', 'domain', 'path',
|
||||
* 'network_id', 'last_updated', 'registered', 'domain_length',
|
||||
* 'path_length', 'site__in' and 'network__in'. Also accepts false,
|
||||
* an empty array, or 'none' to disable `ORDER BY` clause.
|
||||
* @type string|array $orderby Site status or array of statuses. Accepts:
|
||||
* - 'id'
|
||||
* - 'domain'
|
||||
* - 'path'
|
||||
* - 'network_id'
|
||||
* - 'last_updated'
|
||||
* - 'registered'
|
||||
* - 'domain_length'
|
||||
* - 'path_length'
|
||||
* - 'site__in'
|
||||
* - 'network__in'
|
||||
* - false, an empty array, or 'none' to disable `ORDER BY` clause.
|
||||
* Default 'id'.
|
||||
* @type string $order How to order retrieved sites. Accepts 'ASC', 'DESC'. Default 'ASC'.
|
||||
* @type int $network_id Limit results to those affiliated with a given network ID. If 0,
|
||||
@ -156,15 +165,18 @@ class WP_Site_Query {
|
||||
* Default empty array.
|
||||
* @type bool $update_site_cache Whether to prime the cache for found sites. Default true.
|
||||
* @type bool $update_site_meta_cache Whether to prime the metadata cache for found sites. Default true.
|
||||
* @type array $meta_query Meta query clauses to limit retrieved sites by. See `WP_Meta_Query`.
|
||||
* Default empty.
|
||||
* @type string $meta_key Limit sites to those matching a specific metadata key.
|
||||
* Can be used in conjunction with `$meta_value`. Default empty.
|
||||
* @type string $meta_value Limit sites to those matching a specific metadata value.
|
||||
* Usually used in conjunction with `$meta_key`. Default empty.
|
||||
* @type string $meta_type Data type that the `$meta_value` column will be CAST to for
|
||||
* comparisons. Default empty.
|
||||
* @type string $meta_compare Comparison operator to test the `$meta_value`. Default empty.
|
||||
* @type string|string[] $meta_key Meta key or keys to filter by.
|
||||
* @type string|string[] $meta_value Meta value or values to filter by.
|
||||
* @type string $meta_compare MySQL operator used for comparing the meta value.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_compare_key MySQL operator used for comparing the meta key.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_type MySQL data type that the meta_value column will be CAST to for comparisons.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_type_key MySQL data type that the meta_key column will be CAST to for comparisons.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type array $meta_query An associative array of WP_Meta_Query arguments.
|
||||
* See WP_Meta_Query::__construct for accepted values.
|
||||
* }
|
||||
*/
|
||||
public function __construct( $query = '' ) {
|
||||
|
@ -88,6 +88,8 @@ class WP_Term_Query {
|
||||
* @since 4.6.0 Introduced 'term_taxonomy_id' parameter.
|
||||
* @since 4.7.0 Introduced 'object_ids' parameter.
|
||||
* @since 4.9.0 Added 'slug__in' support for 'orderby'.
|
||||
* @since 5.1.0 Introduced the 'meta_compare_key' parameter.
|
||||
* @since 5.3.0 Introduced the 'meta_type_key' parameter.
|
||||
*
|
||||
* @param string|array $query {
|
||||
* Optional. Array or query string of term query parameters. Default empty.
|
||||
@ -97,17 +99,17 @@ class WP_Term_Query {
|
||||
* @type int|int[] $object_ids Object ID, or array of object IDs. Results will be
|
||||
* limited to terms associated with these objects.
|
||||
* @type string $orderby Field(s) to order terms by. Accepts:
|
||||
* * Term fields ('name', 'slug', 'term_group', 'term_id', 'id',
|
||||
* - Term fields ('name', 'slug', 'term_group', 'term_id', 'id',
|
||||
* 'description', 'parent', 'term_order'). Unless `$object_ids`
|
||||
* is not empty, 'term_order' is treated the same as 'term_id'.
|
||||
* * 'count' to use the number of objects associated with the term.
|
||||
* * 'include' to match the 'order' of the `$include` param.
|
||||
* * 'slug__in' to match the 'order' of the `$slug` param.
|
||||
* * 'meta_value'
|
||||
* * 'meta_value_num'.
|
||||
* * The value of `$meta_key`.
|
||||
* * The array keys of `$meta_query`.
|
||||
* * 'none' to omit the ORDER BY clause.
|
||||
* - 'count' to use the number of objects associated with the term.
|
||||
* - 'include' to match the 'order' of the `$include` param.
|
||||
* - 'slug__in' to match the 'order' of the `$slug` param.
|
||||
* - 'meta_value'
|
||||
* - 'meta_value_num'.
|
||||
* - The value of `$meta_key`.
|
||||
* - The array keys of `$meta_query`.
|
||||
* - 'none' to omit the ORDER BY clause.
|
||||
* Default 'name'.
|
||||
* @type string $order Whether to order terms in ascending or descending order.
|
||||
* Accepts 'ASC' (ascending) or 'DESC' (descending).
|
||||
@ -123,25 +125,25 @@ class WP_Term_Query {
|
||||
* along with all of their descendant terms. If `$include` is
|
||||
* non-empty, `$exclude_tree` is ignored. Default empty array.
|
||||
* @type int|string $number Maximum number of terms to return. Accepts ''|0 (all) or any
|
||||
* positive number. Default ''|0 (all). Note that $number may
|
||||
* positive number. Default ''|0 (all). Note that `$number` may
|
||||
* not return accurate results when coupled with `$object_ids`.
|
||||
* See #41796 for details.
|
||||
* @type int $offset The number by which to offset the terms query. Default empty.
|
||||
* @type string $fields Term fields to query for. Accepts:
|
||||
* * 'all' Returns an array of complete term objects (`WP_Term[]`).
|
||||
* * 'all_with_object_id' Returns an array of term objects
|
||||
* - 'all' Returns an array of complete term objects (`WP_Term[]`).
|
||||
* - 'all_with_object_id' Returns an array of term objects
|
||||
* with the 'object_id' param (`WP_Term[]`). Works only
|
||||
* when the `$object_ids` parameter is populated.
|
||||
* * 'ids' Returns an array of term IDs (`int[]`).
|
||||
* * 'tt_ids' Returns an array of term taxonomy IDs (`int[]`).
|
||||
* * 'names' Returns an array of term names (`string[]`).
|
||||
* * 'slugs' Returns an array of term slugs (`string[]`).
|
||||
* * 'count' Returns the number of matching terms (`int`).
|
||||
* * 'id=>parent' Returns an associative array of parent term IDs,
|
||||
* - 'ids' Returns an array of term IDs (`int[]`).
|
||||
* - 'tt_ids' Returns an array of term taxonomy IDs (`int[]`).
|
||||
* - 'names' Returns an array of term names (`string[]`).
|
||||
* - 'slugs' Returns an array of term slugs (`string[]`).
|
||||
* - 'count' Returns the number of matching terms (`int`).
|
||||
* - 'id=>parent' Returns an associative array of parent term IDs,
|
||||
* keyed by term ID (`int[]`).
|
||||
* * 'id=>name' Returns an associative array of term names,
|
||||
* - 'id=>name' Returns an associative array of term names,
|
||||
* keyed by term ID (`string[]`).
|
||||
* * 'id=>slug' Returns an associative array of term slugs,
|
||||
* - 'id=>slug' Returns an associative array of term slugs,
|
||||
* keyed by term ID (`string[]`).
|
||||
* Default 'all'.
|
||||
* @type bool $count Whether to return a term count. If true, will take precedence
|
||||
@ -176,15 +178,18 @@ class WP_Term_Query {
|
||||
* @type string $cache_domain Unique cache key to be produced when this query is stored in
|
||||
* an object cache. Default 'core'.
|
||||
* @type bool $update_term_meta_cache Whether to prime meta caches for matched terms. Default true.
|
||||
* @type array $meta_query Meta query clauses to limit retrieved terms by.
|
||||
* See `WP_Meta_Query`. Default empty.
|
||||
* @type string $meta_key Limit terms to those matching a specific metadata key.
|
||||
* Can be used in conjunction with `$meta_value`. Default empty.
|
||||
* @type string $meta_value Limit terms to those matching a specific metadata value.
|
||||
* Usually used in conjunction with `$meta_key`. Default empty.
|
||||
* @type string $meta_type MySQL data type that the `$meta_value` will be CAST to for
|
||||
* comparisons. Default empty.
|
||||
* @type string $meta_compare Comparison operator to test the 'meta_value'. Default empty.
|
||||
* @type string|string[] $meta_key Meta key or keys to filter by.
|
||||
* @type string|string[] $meta_value Meta value or values to filter by.
|
||||
* @type string $meta_compare MySQL operator used for comparing the meta value.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_compare_key MySQL operator used for comparing the meta key.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_type MySQL data type that the meta_value column will be CAST to for comparisons.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_type_key MySQL data type that the meta_key column will be CAST to for comparisons.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type array $meta_query An associative array of WP_Meta_Query arguments.
|
||||
* See WP_Meta_Query::__construct for accepted values.
|
||||
* }
|
||||
*/
|
||||
public function __construct( $query = '' ) {
|
||||
|
@ -136,6 +136,8 @@ class WP_User_Query {
|
||||
* querying for all users with using -1.
|
||||
* @since 4.7.0 Added 'nicename', 'nicename__in', 'nicename__not_in', 'login', 'login__in',
|
||||
* and 'login__not_in' parameters.
|
||||
* @since 5.1.0 Introduced the 'meta_compare_key' parameter.
|
||||
* @since 5.3.0 Introduced the 'meta_type_key' parameter.
|
||||
* @since 5.9.0 Added 'capability', 'capability__in', and 'capability__not_in' parameters.
|
||||
*
|
||||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
@ -152,6 +154,18 @@ class WP_User_Query {
|
||||
* roles. Default empty array.
|
||||
* @type string[] $role__not_in An array of role names to exclude. Users matching one or more of these
|
||||
* roles will not be included in results. Default empty array.
|
||||
* @type string|string[] $meta_key Meta key or keys to filter by.
|
||||
* @type string|string[] $meta_value Meta value or values to filter by.
|
||||
* @type string $meta_compare MySQL operator used for comparing the meta value.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_compare_key MySQL operator used for comparing the meta key.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_type MySQL data type that the meta_value column will be CAST to for comparisons.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type string $meta_type_key MySQL data type that the meta_key column will be CAST to for comparisons.
|
||||
* See WP_Meta_Query::__construct for accepted values and default value.
|
||||
* @type array $meta_query An associative array of WP_Meta_Query arguments.
|
||||
* See WP_Meta_Query::__construct for accepted values.
|
||||
* @type string $capability An array or a comma-separated list of capability names that users must match
|
||||
* to be included in results. Note that this is an inclusive list: users
|
||||
* must match *each* capability.
|
||||
@ -165,12 +179,6 @@ class WP_User_Query {
|
||||
* capabilities will not be included in results.
|
||||
* Does NOT work for capabilities not in the database or filtered via {@see 'map_meta_cap'}.
|
||||
* Default empty array.
|
||||
* @type string $meta_key User meta key. Default empty.
|
||||
* @type string $meta_value User meta value. Default empty.
|
||||
* @type string $meta_compare Comparison operator to test the `$meta_value`. Accepts '=', '!=',
|
||||
* '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN',
|
||||
* 'BETWEEN', 'NOT BETWEEN', 'EXISTS', 'NOT EXISTS', 'REGEXP',
|
||||
* 'NOT REGEXP', or 'RLIKE'. Default '='.
|
||||
* @type int[] $include An array of user IDs to include. Default empty array.
|
||||
* @type int[] $exclude An array of user IDs to exclude. Default empty array.
|
||||
* @type string $search Search keyword. Searches for possible string matches on columns.
|
||||
@ -181,13 +189,23 @@ class WP_User_Query {
|
||||
* Default empty array.
|
||||
* @type string|array $orderby Field(s) to sort the retrieved users by. May be a single value,
|
||||
* an array of values, or a multi-dimensional array with fields as
|
||||
* keys and orders ('ASC' or 'DESC') as values. Accepted values are
|
||||
* 'ID', 'display_name' (or 'name'), 'include', 'user_login'
|
||||
* (or 'login'), 'login__in', 'user_nicename' (or 'nicename'),
|
||||
* 'nicename__in', 'user_email (or 'email'), 'user_url' (or 'url'),
|
||||
* 'user_registered' (or 'registered'), 'post_count', 'meta_value',
|
||||
* 'meta_value_num', the value of `$meta_key`, or an array key of
|
||||
* `$meta_query`. To use 'meta_value' or 'meta_value_num', `$meta_key`
|
||||
* keys and orders ('ASC' or 'DESC') as values. Accepted values are:
|
||||
* - 'ID'
|
||||
* - 'display_name' (or 'name')
|
||||
* - 'include'
|
||||
* - 'user_login' (or 'login')
|
||||
* - 'login__in'
|
||||
* - 'user_nicename' (or 'nicename'),
|
||||
* - 'nicename__in'
|
||||
* - 'user_email (or 'email')
|
||||
* - 'user_url' (or 'url'),
|
||||
* - 'user_registered' (or 'registered')
|
||||
* - 'post_count'
|
||||
* - 'meta_value',
|
||||
* - 'meta_value_num'
|
||||
* - The value of `$meta_key`
|
||||
* - An array key of `$meta_query`
|
||||
* To use 'meta_value' or 'meta_value_num', `$meta_key`
|
||||
* must be also be defined. Default 'user_login'.
|
||||
* @type string $order Designates ascending or descending order of users. Order values
|
||||
* passed as part of an `$orderby` array take precedence over this
|
||||
@ -204,10 +222,17 @@ class WP_User_Query {
|
||||
* is not needed, setting this to false can improve performance.
|
||||
* Default true.
|
||||
* @type string|array $fields Which fields to return. Single or all fields (string), or array
|
||||
* of fields. Accepts 'ID', 'display_name', 'user_login',
|
||||
* 'user_nicename', 'user_email', 'user_url', 'user_registered'.
|
||||
* Use 'all' for all fields and 'all_with_meta' to include
|
||||
* meta fields. Default 'all'.
|
||||
* of fields. Accepts:
|
||||
* - 'ID'
|
||||
* - 'display_name'
|
||||
* - 'user_login'
|
||||
* - 'user_nicename'
|
||||
* - 'user_email'
|
||||
* - 'user_url'
|
||||
* - 'user_registered'
|
||||
* - 'all' for all fields
|
||||
* - 'all_with_meta' to include meta fields.
|
||||
* Default 'all'.
|
||||
* @type string $who Type of users to query. Accepts 'authors'.
|
||||
* Default empty (all users).
|
||||
* @type bool|array $has_published_posts Pass an array of post types to filter results to users who have
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-alpha-52225';
|
||||
$wp_version = '5.9-alpha-52226';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
x
Reference in New Issue
Block a user