From e555c51adb9b676774b8202794072653858e768a Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Sun, 7 Jan 2007 02:10:50 +0000 Subject: [PATCH] Don't show categories that are exclusively for either posts or links, unless it's used for both. git-svn-id: https://develop.svn.wordpress.org/trunk@4687 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index e6930f8dd3..07766f9db8 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -600,7 +600,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 ORDER BY category_count DESC" ); + return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND ( link_count = 0 OR category_count != 0 ) ORDER BY category_count DESC" ); } function sort_cats( $cat1, $cat2 ) { @@ -674,7 +674,7 @@ function dropdown_categories( $default = 0 ) { function return_link_categories_list( $parent = 0 ) { global $wpdb; - return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY link_count DESC" ); + return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND (category_count = 0 OR link_count != 0) ORDER BY link_count DESC" ); } function get_nested_link_categories( $default = 0, $parent = 0 ) {