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: http://svn.automattic.com/wordpress/trunk@14495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
75c38f3492
commit
d8e2d6d4a9
|
@ -2933,8 +2933,12 @@ function wp_filter_object_list( $list, $args = array(), $operator = 'and', $fiel
|
||||||
|
|
||||||
foreach ( $list as $key => $obj ) {
|
foreach ( $list as $key => $obj ) {
|
||||||
$matched = count(array_intersect_assoc(get_object_vars($obj), $args));
|
$matched = count(array_intersect_assoc(get_object_vars($obj), $args));
|
||||||
if ( ('and' == $operator && $matched == $count) || ('or' == $operator && $matched <= $count) )
|
if ( ('and' == $operator && $matched == $count) || ('or' == $operator && $matched <= $count) ) {
|
||||||
$filtered[$key] = $field ? $obj->$field : $obj;
|
if ( $field )
|
||||||
|
$filtered[] = $obj->$field;
|
||||||
|
else
|
||||||
|
$filtered[$key] = $obj;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $filtered;
|
return $filtered;
|
||||||
|
|
Loading…
Reference in New Issue