Created
September 13, 2019 14:19
-
-
Save rossberenson/c40725474a338dff8ac40e3cd72bf9df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Filter taxonomy terms by term_order if term_order is specified | |
* | |
* @param string $orderby Method to order terms by | |
* @param array $query_vars The query | |
* @param array $taxonomies Array of taxonomies | |
*/ | |
function filter_terms_order( $orderby, $query_vars, $taxonomies ) { | |
return 'term_order' === $query_vars['orderby'] ? 'term_order' : $orderby; | |
} | |
add_filter( 'get_terms_orderby', 'filter_terms_order', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment