Make WordPress Core


Ignore:
Timestamp:
04/25/2009 07:48:17 AM (15 years ago)
Author:
azaozz
Message:

Fix categorynot_in and tagnot_in running empty, props coffee2code, fixes #9645

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r11085 r11086  
    18051805            } else {
    18061806                $ids = get_objects_in_term($q['category__not_in'], 'category');
    1807                 if ( is_wp_error( $ids ) )
    1808                     $ids = array();
    1809                 if ( is_array($ids) && count($ids > 0) ) {
    1810                     $out_posts = "'" . implode("', '", $ids) . "'";
    1811                     $whichcat .= " AND $wpdb->posts.ID NOT IN ($out_posts)";
    1812                 }
     1807                if ( !is_wp_error($ids) && is_array($ids) && count($ids) > 0 )
     1808                    $whichcat .= " AND $wpdb->posts.ID NOT IN ('" . implode("', '", $ids) . "')";
    18131809            }
    18141810        }
     
    18981894            } else {
    18991895                $ids = get_objects_in_term($q['tag__not_in'], 'post_tag');
    1900                 if ( is_wp_error( $ids ) )
    1901                     $ids = array();
    1902                 if ( is_array($ids) && count($ids > 0) ) {
    1903                     $out_posts = "'" . implode("', '", $ids) . "'";
    1904                     $whichcat .= " AND $wpdb->posts.ID NOT IN ($out_posts)";
    1905                 }
     1896                if ( !is_wp_error($ids) && is_array($ids) && count($ids) > 0 )
     1897                    $whichcat .= " AND $wpdb->posts.ID NOT IN ('" . implode("', '", $ids) . "')";
    19061898            }
    19071899        }
Note: See TracChangeset for help on using the changeset viewer.