From bb785c8b708131cf80d8e9b8215f41a5196bd09b Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 19 May 2008 22:17:49 +0000 Subject: Put checked categories at the top of the checklist. Props mdawaffe. see #WP7000 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1299 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/admin-ajax.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'wp-admin/admin-ajax.php') diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 4e34333..663880e 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -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( -- cgit