get_terms_orderby filter-hookWP 2.8.0

Filters the ORDERBY clause of the terms query.

Usage

add_filter( 'get_terms_orderby', 'wp_kama_get_terms_orderby_filter', 10, 3 );

/**
 * Function for `get_terms_orderby` filter-hook.
 * 
 * @param string   $orderby    `ORDERBY` clause of the terms query.
 * @param array    $args       An array of term query arguments.
 * @param string[] $taxonomies An array of taxonomy names.
 *
 * @return string
 */
function wp_kama_get_terms_orderby_filter( $orderby, $args, $taxonomies ){

	// filter...
	return $orderby;
}
$orderby(string)
ORDERBY clause of the terms query.
$args(array)
An array of term query arguments.
$taxonomies(string[])
An array of taxonomy names.

Changelog

Since 2.8.0 Introduced.

Where the hook is called

WP_Term_Query::parse_orderby()
get_terms_orderby
wp-includes/class-wp-term-query.php 957
$orderby = apply_filters( 'get_terms_orderby', $orderby, $this->query_vars, $this->query_vars['taxonomy'] );

Where the hook is used in WordPress

Usage not found.