Always put checked categories first.
git-svn-id: http://svn.automattic.com/wordpress/trunk@4548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1097f574c1
commit
b16435a39a
|
@ -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