terms_clauses хук-фильтрWP 3.1.0

Filters the terms query SQL clauses.

Использование

add_filter( 'terms_clauses', 'wp_kama_terms_clauses_filter', 10, 3 );

/**
 * Function for `terms_clauses` filter-hook.
 * 
 * @param string[] $clauses    Associative array of the clauses for the query.
 * @param string[] $taxonomies An array of taxonomy names.
 * @param array    $args       An array of term query arguments.
 *
 * @return string[]
 */
function wp_kama_terms_clauses_filter( $clauses, $taxonomies, $args ){

	// filter...
	return $clauses;
}
$clauses(string[])

Associative array of the clauses for the query.

  • fields(строка)
    The SELECT clause of the query.

  • join(строка)
    The JOIN clause of the query.

  • where(строка)
    The WHERE clause of the query.

  • distinct(строка)
    The DISTINCT clause of the query.

  • orderby(строка)
    The ORDER BY clause of the query.

  • order(строка)
    The ORDER clause of the query.

  • limits(строка)
    The LIMIT clause of the query.
$taxonomies(string[])
An array of taxonomy names.
$args(массив)
An array of term query arguments.

Список изменений

С версии 3.1.0 Введена.

Где вызывается хук

WP_Term_Query::get_terms()
terms_clauses
wp-includes/class-wp-term-query.php 734
$clauses = apply_filters( 'terms_clauses', compact( $pieces ), $taxonomies, $args );

Где используется хук в WordPress

Использование не найдено.