Streamline `get_terms()` parameter documentation.
Since 4.6, `get_terms()` has been a wrapper for `WP_Term_Query`. Full parameter documentation lives with the class, and `get_terms()` should reference rather than duplicate it. Props shashwatmittal. Fixes #37075. git-svn-id: https://develop.svn.wordpress.org/trunk@40292 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3025ba4c8f
commit
24b221bd34
|
@ -1020,76 +1020,11 @@ function get_term_to_edit( $id, $taxonomy ) {
|
||||||
* @global wpdb $wpdb WordPress database abstraction object.
|
* @global wpdb $wpdb WordPress database abstraction object.
|
||||||
* @global array $wp_filter
|
* @global array $wp_filter
|
||||||
*
|
*
|
||||||
* @param array|string $args {
|
* @param string|array $args Optional. Array or string of arguments. See WP_Term_Query::__construct()
|
||||||
* Optional. Array or string of arguments to get terms.
|
* for information on accepted arguments. Default empty.
|
||||||
*
|
* @param array $deprecated Argument array, when using the legacy function parameter format. If present, this
|
||||||
* @type string|array $taxonomy Taxonomy name, or array of taxonomies, to which results should
|
* parameter will be interpreted as `$args`, and the first function parameter will
|
||||||
* be limited.
|
* be parsed as a taxonomy or array of taxonomies.
|
||||||
* @type string $orderby Field(s) to order terms by. Accepts term fields ('name', 'slug',
|
|
||||||
* 'term_group', 'term_id', 'id', 'description'), 'count' for term
|
|
||||||
* taxonomy count, 'include' to match the 'order' of the $include param,
|
|
||||||
* 'meta_value', 'meta_value_num', the value of `$meta_key`, the array
|
|
||||||
* keys of `$meta_query`, or 'none' to omit the ORDER BY clause.
|
|
||||||
* Defaults to 'name'.
|
|
||||||
* @type string $order Whether to order terms in ascending or descending order.
|
|
||||||
* Accepts 'ASC' (ascending) or 'DESC' (descending).
|
|
||||||
* Default 'ASC'.
|
|
||||||
* @type bool|int $hide_empty Whether to hide terms not assigned to any posts. Accepts
|
|
||||||
* 1|true or 0|false. Default 1|true.
|
|
||||||
* @type array|string $include Array or comma/space-separated string of term ids to include.
|
|
||||||
* Default empty array.
|
|
||||||
* @type array|string $exclude Array or comma/space-separated string of term ids to exclude.
|
|
||||||
* If $include is non-empty, $exclude is ignored.
|
|
||||||
* Default empty array.
|
|
||||||
* @type array|string $exclude_tree Array or comma/space-separated string of term ids to exclude
|
|
||||||
* 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).
|
|
||||||
* @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), 'ids' (returns an array of ids), 'id=>parent' (returns
|
|
||||||
* an associative array with ids as keys, parent term IDs as values),
|
|
||||||
* 'names' (returns an array of term names), 'count' (returns the number
|
|
||||||
* of matching terms), 'id=>name' (returns an associative array with ids
|
|
||||||
* as keys, term names as values), or 'id=>slug' (returns an associative
|
|
||||||
* array with ids as keys, term slugs as values). Default 'all'.
|
|
||||||
* @type string|array $name Optional. Name or array of names to return term(s) for. Default empty.
|
|
||||||
* @type string|array $slug Optional. Slug or array of slugs to return term(s) for. Default empty.
|
|
||||||
* @type bool $hierarchical Whether to include terms that have non-empty descendants (even
|
|
||||||
* if $hide_empty is set to true). Default true.
|
|
||||||
* @type string $search Search criteria to match terms. Will be SQL-formatted with
|
|
||||||
* wildcards before and after. Default empty.
|
|
||||||
* @type string $name__like Retrieve terms with criteria by which a term is LIKE $name__like.
|
|
||||||
* Default empty.
|
|
||||||
* @type string $description__like Retrieve terms where the description is LIKE $description__like.
|
|
||||||
* Default empty.
|
|
||||||
* @type bool $pad_counts Whether to pad the quantity of a term's children in the quantity
|
|
||||||
* of each term's "count" object variable. Default false.
|
|
||||||
* @type string $get Whether to return terms regardless of ancestry or whether the terms
|
|
||||||
* are empty. Accepts 'all' or empty (disabled). Default empty.
|
|
||||||
* @type int $child_of Term ID to retrieve child terms of. If multiple taxonomies
|
|
||||||
* are passed, $child_of is ignored. Default 0.
|
|
||||||
* @type int|string $parent Parent term ID to retrieve direct-child terms of. Default empty.
|
|
||||||
* @type bool $childless True to limit results to terms that have no children. This parameter
|
|
||||||
* has no effect on non-hierarchical taxonomies. Default false.
|
|
||||||
* @type string $cache_domain Unique cache key to be produced when this query is stored in an
|
|
||||||
* object cache. Default is '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 Type of object metadata is for (e.g., comment, post, or user).
|
|
||||||
* Default empty.
|
|
||||||
* @type string $meta_compare Comparison operator to test the 'meta_value'. Default empty.
|
|
||||||
* @type bool $suppress_filter Whether to suppress the {@see 'get_terms'} filter. Default false.
|
|
||||||
* }
|
|
||||||
* @param array $deprecated Argument array, when using the legacy function parameter format. If present, this
|
|
||||||
* parameter will be interpreted as `$args`, and the first function parameter will
|
|
||||||
* be parsed as a taxonomy or array of taxonomies.
|
|
||||||
* @return array|int|WP_Error List of WP_Term instances and their children. Will return WP_Error, if any of $taxonomies
|
* @return array|int|WP_Error List of WP_Term instances and their children. Will return WP_Error, if any of $taxonomies
|
||||||
* do not exist.
|
* do not exist.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue