Always put checked categories first.
git-svn-id: https://develop.svn.wordpress.org/trunk@4548 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1950f6ec7b
commit
aae9c4b07f
@ -598,7 +598,10 @@ function return_categories_list( $parent = 0 ) {
|
||||
}
|
||||
|
||||
function sort_cats( $cat1, $cat2 ) {
|
||||
return strcasecmp( $cat1['cat_name'], $cat2['cat_name'] );
|
||||
if ( $cat1['checked'] || $cat2['checked'] )
|
||||
return ( $cat1['checked'] && !$cat2['checked'] ) ? -1 : 1;
|
||||
else
|
||||
return strcasecmp( $cat1['cat_name'], $cat2['cat_name'] );
|
||||
}
|
||||
|
||||
function get_nested_categories( $default = 0, $parent = 0 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user