apply_filters( 'terms_clauses', string[] $clauses, string[] $taxonomies, array $args )
- Since
- 3.1.0
Filters the terms query SQL clauses.
Compatibility
- WordPress
- since 3.1.0
- 6.7.10
- 6.8.11
- 6.9.10
- 7.0.7
- 7.1.3
Present in every tracked release (6.7.10 to 7.1.3).
Parameters
$clausesstring[]- { Associative array of the clauses for the query.
@type string $fields The SELECT clause of the query.
@type string $join The JOIN clause of the query.
@type string $where The WHERE clause of the query.
@type string $distinct The DISTINCT clause of the query.
@type string $orderby The ORDER BY clause of the query.
@type string $order The ORDER clause of the query.
@type string $limits The LIMIT clause of the query.
}$fieldsstringThe SELECT clause of the query.$joinstringThe JOIN clause of the query.$wherestringThe WHERE clause of the query.$distinctstringThe DISTINCT clause of the query.$orderbystringThe ORDER BY clause of the query.$orderstringThe ORDER clause of the query.$limitsstringThe LIMIT clause of the query.
$taxonomiesstring[]- An array of taxonomy names.
$argsarray- An array of term query arguments.
Where this hook fires · 1
wp-includes/class-wp-term-query.php:731WP_Term_Query::get_terms()
Source code
* @type string $order The ORDER clause of the query. * @type string $limits The LIMIT clause of the query. * } * @param string[] $taxonomies An array of taxonomy names. * @param array $args An array of term query arguments. */ $clauses = apply_filters( 'terms_clauses', compact( $pieces ), $taxonomies, $args ); $fields = isset( $clauses['fields'] ) ? $clauses['fields'] : ''; $join = isset( $clauses['join'] ) ? $clauses['join'] : ''; $where = isset( $clauses['where'] ) ? $clauses['where'] : ''; $distinct = isset( $clauses['distinct'] ) ? $clauses['distinct'] : ''; $orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';Changelog
Introduced in 3.1.0. Unchanged from 6.7.10 through 7.1.3.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.10 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.