apply_filters( ‘get_terms_args’, array $args, string[] $taxonomies )

Filters the terms query arguments.

Parameters

$argsarray
An array of get_terms() arguments.
More Arguments from get_terms( … $args )Array or string of arguments. See WP_Term_Query::__construct() for information on accepted arguments.
$taxonomiesstring[]
An array of taxonomy names.

Source

$args = apply_filters( 'get_terms_args', $args, $taxonomies );

Changelog

VersionDescription
3.1.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    To reorder categories list in functions.php

    /**
     * Order categories
     * 
     */
    function wp_custom_sort_get_terms_args( $args, $taxonomies ) 
    {
        $args['orderby'] = 'description';
        $args['order']   = 'ASC';
    
        return $args;
    }
    add_filter( 'get_terms_args', 'wp_custom_sort_get_terms_args', 10, 2 );

You must log in before being able to contribute a note or feedback.