Uses
Uses | Description |
---|---|
wp-includes/class-wp-term-query.php: WP_Term_Query::query() | Sets up the query for retrieving terms. |
Constructor.
Sets up the term query, based on the query vars passed.
(string|array) (Optional) Array or query string of term query parameters.
$object_ids
is not empty, 'term_order' is treated the same as 'term_id'.$meta_key
.$meta_query
.WP_Term[]
).WP_Term[]
). Works only when the $object_ids
parameter is populated.int[]
).int[]
).string[]
).string[]
).int
).int[]
).string[]
).string[]
). Default 'all'.$fields
. Default false.$name__like
. $description__like
. WP_Meta_Query
. $meta_value
. $meta_key
. $meta_value
will be CAST to for comparisons. Default value: ''
File: wp-includes/class-wp-term-query.php
public function __construct( $query = '' ) { $this->query_var_defaults = array( 'taxonomy' => null, 'object_ids' => null, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => true, 'include' => array(), 'exclude' => array(), 'exclude_tree' => array(), 'number' => '', 'offset' => '', 'fields' => 'all', 'count' => false, 'name' => '', 'slug' => '', 'term_taxonomy_id' => '', 'hierarchical' => true, 'search' => '', 'name__like' => '', 'description__like' => '', 'pad_counts' => false, 'get' => '', 'child_of' => 0, 'parent' => '', 'childless' => false, 'cache_domain' => 'core', 'update_term_meta_cache' => true, 'meta_query' => '', 'meta_key' => '', 'meta_value' => '', 'meta_type' => '', 'meta_compare' => '', ); if ( ! empty( $query ) ) { $this->query( $query ); } }
Version | Description |
---|---|
4.9.0 | Added 'slug__in' support for 'orderby'. |
4.7.0 | Introduced 'object_ids' parameter. |
4.6.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_term_query/__construct