WPDev.one
Core Function
View Source on Trac ↗

wp_filter_object_list()

wp_filter_object_list( mixed $input_list, mixed $args = array(), mixed $operator = 'and', mixed $field = false )

Filters a list of objects, based on a set of key => value arguments.

Parameters 4 required

Name / Type Description
$input_list
array

An array of objects to filter.

Required
array

$args Optional. An array of key => value arguments to match against each object. Default empty array.

Required
string

$operator Optional. The logical operation to perform. 'AND' means all elements from the array must match. 'OR' means only one element needs to match. 'NOT' means no elements may match. Default 'AND'.

Required
mixed

(bool | string) $field Optional. A field from the object to place instead of the entire object. Default false.

Required

Return Value

(array)
A list of objects or object fields.

Function Information

Since Version
3.0.0
Source File
wp-includes/functions.php
Advertisement