mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Put checked categories at the top of the checlist. Props mdawaffe. fixes #7000 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@7956 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -150,6 +150,9 @@ case 'add-category' : // On the Fly
|
||||
$parent = 0;
|
||||
$post_category = isset($_POST['post_category'])? (array) $_POST['post_category'] : array();
|
||||
$checked_categories = array_map( 'absint', (array) $post_category );
|
||||
$popular_ids = isset( $_POST['popular_ids'] ) ?
|
||||
array_map( 'absint', explode( ',', $_POST['popular_ids'] ) ) :
|
||||
false;
|
||||
|
||||
$x = new WP_Ajax_Response();
|
||||
foreach ( $names as $cat_name ) {
|
||||
@@ -163,7 +166,7 @@ case 'add-category' : // On the Fly
|
||||
continue;
|
||||
$category = get_category( $cat_id );
|
||||
ob_start();
|
||||
wp_category_checklist( 0, $cat_id, $checked_categories );
|
||||
wp_category_checklist( 0, $cat_id, $checked_categories, $popular_ids );
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$x->add( array(
|
||||
|
||||
Reference in New Issue
Block a user