diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 39b7bb1cb..4da541005 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -3034,6 +3034,9 @@ function wp_array_slice_assoc( $array, $keys ) { * @return array A list of objects or object fields */ 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 ); if ( $field ) @@ -3057,6 +3060,9 @@ function wp_filter_object_list( $list, $args = array(), $operator = 'and', $fiel * @return array */ function wp_list_filter( $list, $args = array(), $operator = 'AND' ) { + if ( ! is_array( $list ) ) + return array(); + if ( empty( $args ) ) return $list;