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 ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.