WordPress.org

Make WordPress Core

Ticket #13109: wp_filter_object_list.2.diff

File wp_filter_object_list.2.diff, 700 bytes (added by scribu, 8 years ago)

added brackets

  • wp-includes/functions.php

     
    29332933
    29342934        foreach ( $list as $key => $obj ) {
    29352935                $matched = count(array_intersect_assoc(get_object_vars($obj), $args));
    2936                 if ( ('and' == $operator && $matched == $count) || ('or' == $operator && $matched <= $count) )
    2937                         $filtered[$key] = $field ? $obj->$field : $obj;
     2936                if ( ('and' == $operator && $matched == $count) || ('or' == $operator && $matched <= $count) ) {
     2937                        if ( $field )
     2938                                $filtered[] = $obj->$field;
     2939                        else
     2940                                $filtered[$key] = $obj;
     2941                }
    29382942        }
    29392943
    29402944        return $filtered;