WordPress.org

Make WordPress Core

Ticket #13109: wp_filter_object_list.diff

File wp_filter_object_list.diff, 593 bytes (added by scribu, 4 years ago)
  • wp-includes/functions.php

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