{"pageProps":{"title":"get_terms_orderby","titleType":"Hook","type":"hooks","content":"

get_terms_orderby WordPress Filter Hook

The get_terms_orderby hook allows you to modify the order in which terms are returned by the get_terms function. The most common use for this hook is to alphabetize terms, but it can also be used to order terms by popularity or by the number of posts in a given term.

apply_filters( 'get_terms_orderby', string $orderby, array $args, string[] $taxonomies ) #

Filters the ORDERBY clause of the terms query.


Parameters

$orderby

(string)ORDERBY clause of the terms query.

$args

(array)An array of term query arguments.

$taxonomies

(string[])An array of taxonomy names.


Top ↑

Source

File: wp-includes/class-wp-term-query.php

View on Trac


Top ↑

Related


Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.
","description":"Filters the ORDERBY clause of the terms query.","sidebarFiles":{"Class":[{"componentTitle":"WP_Term_Query","componentLink":"/reference/classes/wp_term_query","private":"","deprecated":""}],"Class Method":[{"componentTitle":"WP_Term_Query::__construct()","componentLink":"/reference/classes/wp_term_query/__construct","private":"","deprecated":""},{"componentTitle":"WP_Term_Query::format_terms()","componentLink":"/reference/classes/wp_term_query/format_terms","private":"","deprecated":""},{"componentTitle":"WP_Term_Query::get_search_sql()","componentLink":"/reference/classes/wp_term_query/get_search_sql","private":"","deprecated":""},{"componentTitle":"WP_Term_Query::get_terms()","componentLink":"/reference/classes/wp_term_query/get_terms","private":"","deprecated":""},{"componentTitle":"WP_Term_Query::parse_order()","componentLink":"/reference/classes/wp_term_query/parse_order","private":"","deprecated":""},{"componentTitle":"WP_Term_Query::parse_orderby_meta()","componentLink":"/reference/classes/wp_term_query/parse_orderby_meta","private":"","deprecated":""},{"componentTitle":"WP_Term_Query::parse_orderby()","componentLink":"/reference/classes/wp_term_query/parse_orderby","private":"","deprecated":""},{"componentTitle":"WP_Term_Query::parse_query()","componentLink":"/reference/classes/wp_term_query/parse_query","private":"","deprecated":""},{"componentTitle":"WP_Term_Query::populate_terms()","componentLink":"/reference/classes/wp_term_query/populate_terms","private":"","deprecated":""},{"componentTitle":"WP_Term_Query::query()","componentLink":"/reference/classes/wp_term_query/query","private":"","deprecated":""}],"Hook":[{"componentTitle":"get_terms_args","componentLink":"/reference/hooks/get_terms_args","private":"","deprecated":""},{"componentTitle":"get_terms_defaults","componentLink":"/reference/hooks/get_terms_defaults","private":"","deprecated":""},{"componentTitle":"get_terms_fields","componentLink":"/reference/hooks/get_terms_fields","private":"","deprecated":""},{"componentTitle":"get_terms_orderby","componentLink":"/reference/hooks/get_terms_orderby","private":"","deprecated":"","active":"active"},{"componentTitle":"list_terms_exclusions","componentLink":"/reference/hooks/list_terms_exclusions","private":"","deprecated":""},{"componentTitle":"parse_term_query","componentLink":"/reference/hooks/parse_term_query","private":"","deprecated":""},{"componentTitle":"pre_get_terms","componentLink":"/reference/hooks/pre_get_terms","private":"","deprecated":""},{"componentTitle":"terms_clauses","componentLink":"/reference/hooks/terms_clauses","private":"","deprecated":""},{"componentTitle":"terms_pre_query","componentLink":"/reference/hooks/terms_pre_query","private":"","deprecated":""}]}},"__N_SSG":true}