From 12985d307f88f54c86c6759e4ac83f8d6b680209 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 7 May 2010 03:24:47 +0000 Subject: [PATCH] Standardize returned array keys when output = 'names'. Return numeric keys. Standardizes get_object_taxonomies with get_taxonomies, get_post_types, and get_post_stati. props scribu. fixes #13109. git-svn-id: https://develop.svn.wordpress.org/trunk@14495 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 4cc95a7fae..e86433b2e8 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2933,8 +2933,12 @@ function wp_filter_object_list( $list, $args = array(), $operator = 'and', $fiel foreach ( $list as $key => $obj ) { $matched = count(array_intersect_assoc(get_object_vars($obj), $args)); - if ( ('and' == $operator && $matched == $count) || ('or' == $operator && $matched <= $count) ) - $filtered[$key] = $field ? $obj->$field : $obj; + if ( ('and' == $operator && $matched == $count) || ('or' == $operator && $matched <= $count) ) { + if ( $field ) + $filtered[] = $obj->$field; + else + $filtered[$key] = $obj; + } } return $filtered;