Last active
February 20, 2025 14:22
-
-
Save abdulawal39/ea7ecd5c7df773ef6e785cb315cfd79b to your computer and use it in GitHub Desktop.
Change the order of pdf cat taxonomy to DESC instead of ASC
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
function tncsupport_pre_get_terms_order( $query ) { | |
if ( is_admin() && ! wp_doing_ajax() ) { | |
return; | |
} | |
if ( isset( $query->query_vars['orderby'] ) && $query->query_vars['orderby'] === 'name' ) { | |
$query->query_vars['order'] = 'DESC'; | |
} | |
} | |
add_action( 'pre_get_terms', 'tncsupport_pre_get_terms_order' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment