diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 3b071a8e19..82377d0ee8 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -494,7 +494,7 @@ function checked($checked, $current) { function return_categories_list($parent = 0) { global $wpdb; - return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent"); + return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY category_count DESC LIMIT 100"); } function sort_cats($cat1, $cat2) { diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 135e385ac0..d1a98c0cec 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -81,7 +81,8 @@ if ( is_month() ) { -get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts ORDER BY post_date DESC"); +get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_date != '0000-00-00 00:00:00' ORDER BY post_date DESC"); + if ( count($arc_result) ) { ?>