Make WordPress Core


Ignore:
Timestamp:
01/10/2007 12:22:17 AM (19 years ago)
Author:
ryan
Message:

Show cats that have neither links or posts.

File:
1 edited

Legend:

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

    r4700 r4712  
    601601function return_categories_list( $parent = 0 ) {
    602602    global $wpdb;
    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" );
     603    return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND ( link_count = 0 OR category_count != 0 OR ( link_count = 0 AND 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 AND (category_count = 0  OR link_count != 0) 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 OR ( link_count = 0 AND category_count = 0 ) ) ORDER BY link_count DESC" );
    678678}
    679679
Note: See TracChangeset for help on using the changeset viewer.