Return early if list is not an array. Props nacin. fixes #16499 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@17427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f0ad00813e
commit
6fbe3c685d
|
@ -3034,6 +3034,9 @@ function wp_array_slice_assoc( $array, $keys ) {
|
||||||
* @return array A list of objects or object fields
|
* @return array A list of objects or object fields
|
||||||
*/
|
*/
|
||||||
function wp_filter_object_list( $list, $args = array(), $operator = 'and', $field = false ) {
|
function wp_filter_object_list( $list, $args = array(), $operator = 'and', $field = false ) {
|
||||||
|
if ( ! is_array( $list ) )
|
||||||
|
return array();
|
||||||
|
|
||||||
$list = wp_list_filter( $list, $args, $operator );
|
$list = wp_list_filter( $list, $args, $operator );
|
||||||
|
|
||||||
if ( $field )
|
if ( $field )
|
||||||
|
@ -3057,6 +3060,9 @@ function wp_filter_object_list( $list, $args = array(), $operator = 'and', $fiel
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function wp_list_filter( $list, $args = array(), $operator = 'AND' ) {
|
function wp_list_filter( $list, $args = array(), $operator = 'AND' ) {
|
||||||
|
if ( ! is_array( $list ) )
|
||||||
|
return array();
|
||||||
|
|
||||||
if ( empty( $args ) )
|
if ( empty( $args ) )
|
||||||
return $list;
|
return $list;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue