Docs: Reformat the orderby
section of WP_Term_Query::__construct()
for better readability.
This makes it more consistent with the `fields` section. See #49572. git-svn-id: https://develop.svn.wordpress.org/trunk@47897 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
33b4f176cd
commit
d57084755d
@ -96,13 +96,17 @@ class WP_Term_Query {
|
|||||||
* be limited.
|
* be limited.
|
||||||
* @type int|array $object_ids Optional. Object ID, or array of object IDs. Results will be
|
* @type int|array $object_ids Optional. Object ID, or array of object IDs. Results will be
|
||||||
* limited to terms associated with these objects.
|
* limited to terms associated with these objects.
|
||||||
* @type string $orderby Field(s) to order terms by. Accepts term fields ('name',
|
* @type string $orderby Field(s) to order terms by. Accepts:
|
||||||
* 'slug', 'term_group', 'term_id', 'id', 'description', 'parent'),
|
* - term fields ('name', 'slug', 'term_group', 'term_id', 'id',
|
||||||
* 'count' for term taxonomy count, 'include' to match the
|
* 'description', 'parent').
|
||||||
* 'order' of the $include param, 'slug__in' to match the
|
* - 'count' for term taxonomy count.
|
||||||
* 'order' of the $slug param, 'meta_value', 'meta_value_num',
|
* - 'include' to match the 'order' of the $include param.
|
||||||
* the value of `$meta_key`, the array keys of `$meta_query`, or
|
* - 'slug__in' to match the 'order' of the $slug param.
|
||||||
* 'none' to omit the ORDER BY clause. Defaults to 'name'.
|
* - 'meta_value', 'meta_value_num'.
|
||||||
|
* - the value of `$meta_key`.
|
||||||
|
* - the array keys of `$meta_query`.
|
||||||
|
* - 'none' to omit the ORDER BY clause.
|
||||||
|
* Defaults to 'name'.
|
||||||
* @type string $order Whether to order terms in ascending or descending order.
|
* @type string $order Whether to order terms in ascending or descending order.
|
||||||
* Accepts 'ASC' (ascending) or 'DESC' (descending).
|
* Accepts 'ASC' (ascending) or 'DESC' (descending).
|
||||||
* Default 'ASC'.
|
* Default 'ASC'.
|
||||||
@ -142,8 +146,8 @@ class WP_Term_Query {
|
|||||||
* Default empty.
|
* Default empty.
|
||||||
* @type int|array $term_taxonomy_id Optional. Term taxonomy ID, or array of term taxonomy IDs,
|
* @type int|array $term_taxonomy_id Optional. Term taxonomy ID, or array of term taxonomy IDs,
|
||||||
* to match when querying terms.
|
* to match when querying terms.
|
||||||
* @type bool $hierarchical Whether to include terms that have non-empty descendants (even
|
* @type bool $hierarchical Whether to include terms that have non-empty descendants
|
||||||
* if $hide_empty is set to true). Default true.
|
* (even if $hide_empty is set to true). Default true.
|
||||||
* @type string $search Search criteria to match terms. Will be SQL-formatted with
|
* @type string $search Search criteria to match terms. Will be SQL-formatted with
|
||||||
* wildcards before and after. Default empty.
|
* wildcards before and after. Default empty.
|
||||||
* @type string $name__like Retrieve terms with criteria by which a term is LIKE
|
* @type string $name__like Retrieve terms with criteria by which a term is LIKE
|
||||||
@ -396,6 +400,7 @@ class WP_Term_Query {
|
|||||||
if ( 'term_order' === $_orderby && empty( $this->query_vars['object_ids'] ) ) {
|
if ( 'term_order' === $_orderby && empty( $this->query_vars['object_ids'] ) ) {
|
||||||
$_orderby = 'term_id';
|
$_orderby = 'term_id';
|
||||||
}
|
}
|
||||||
|
|
||||||
$orderby = $this->parse_orderby( $_orderby );
|
$orderby = $this->parse_orderby( $_orderby );
|
||||||
|
|
||||||
if ( $orderby ) {
|
if ( $orderby ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user