Changeset 4687

Show
Ignore:
Timestamp:
01/07/07 02:10:50 (2 years ago)
Author:
matt
Message:

Don't show categories that are exclusively for either posts or links, unless it's used for both.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/admin-functions.php

    r4670 r4687  
    601601function return_categories_list( $parent = 0 ) { 
    602602    global $wpdb; 
    603     return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY category_count DESC" ); 
     603    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" ); 
    604604} 
    605605 
     
    675675function return_link_categories_list( $parent = 0 ) { 
    676676    global $wpdb; 
    677     return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY link_count DESC" ); 
     677    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" ); 
    678678} 
    679679