Snippets: Custom Total Grid Filter Orderby Arguments

The grid filters included with the portfolio grid, staff grid, testimonials grid, post types grid modules in Total, use the core get_terms function in WordPress and it includes a filter "vcex_grid_filter_args" you can use to hook into and alter the arguments via your child theme if you wanted to customize things a bit more. Below is a sample snippet. Of course if you want something very custom you'll want to use this method instead.

/*
 * Alter the Total grid filter arguments
 *
 * @link https://developer.wordpress.org/reference/functions/get_terms/
 *
 */
add_filter( 'vcex_grid_filter_args', function( $args ) {
	$args['orderby'] = 'name';
	$args['order']   = 'ASC';
	return $args;
} );

Snippet Type: PHP

Posted Under: Other

All PHP snippets should be added via a child theme's functions.php file.