mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-30 23:30:05 +00:00
Return early if list is not an array. Props nacin. fixes #16499 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@17427 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user