Make WordPress Core

Changeset 4687


Ignore:
Timestamp:
01/07/2007 02:10:50 AM (18 years ago)
Author:
matt
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.