Created
August 30, 2013 13:35
-
-
Save clifgriffin/6389910 to your computer and use it in GitHub Desktop.
Leverage https://gist.github.com/clifgriffin/6389814 to sort terms naturally on post edit screens.
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
<?php | |
add_filter('get_terms_orderby', 'reorder_categories_admin', 20, 2); | |
function reorder_categories_admin($orderby, $args) | |
{ | |
global $pagenow; | |
// If not category, bail | |
if ( ! isset($args['taxonomy']) || $args['taxonomy'] != 'category' ) return $orderby; | |
if( is_admin() && ( $pagenow == "post-new.php" || $pagenow == "edit.php" ) ) { | |
return 'natural'; | |
} | |
else { | |
return $orderby; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment