wppaste
WordPress

wp_list_filter( array $input_list, array $args = array(), string $operator = 'AND' ): array

Since
3.1.0, 4.7.0, 5.9.0
Source
wp-includes/functions.php:5461
Filters a list of objects, based on a set of key => value arguments.

Description

Retrieves the objects from the list that match the given arguments.Key represents property name, and value represents property value. If an object has more properties than those specified in arguments, that will not disqualify it. When using the 'AND' operator, any missing properties will disqualify it. If you want to retrieve a particular field from all matching objects, use wp_filter_object_list() instead.

Parameters

$input_listarray
An array of objects to filter.
$argsarrayoptional
An array of key => value arguments to match against each object. Default empty array.Default: array()
$operatorstringoptional
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'.Default: 'AND'

Return

array
Array of found values.

Uses · 1

Used by · 15

Show all 15

Source

function wp_list_filter( $input_list, $args = array(), $operator = 'AND' ) {	return wp_filter_object_list( $input_list, $args, $operator );}

History

Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

5.9.0
Converted into a wrapper for wp_filter_object_list().from the docblock
4.7.0
Uses WP_List_Util class.from the docblock
3.1.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/functions.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.