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
- wp_filter_object_list()Filters a list of objects, based on a set of key => value arguments.
Used by · 15
- WP_Automatic_Updater::send_debug_email()Prepares and sends an email of a full log of background update results, useful for debugging and geekery.
- WP_REST_Menu_Items_Controller::get_item_schema()Retrieves the nav menu item's schema, conforming to JSON Schema.
- WP_REST_Menu_Items_Controller::prepare_item_for_response()Prepares a single nav menu item output for response.
- WP_REST_Post_Types_Controller::prepare_item_for_response()Prepares a post type object for serialization.
- WP_REST_Posts_Controller::check_assign_terms_permission()Checks whether current user can assign all terms sent with the current request.
- WP_REST_Posts_Controller::get_available_actions()Gets the link relations available for the post and current user.
- WP_REST_Posts_Controller::get_item_schema()Retrieves the post's schema, conforming to JSON Schema.
- WP_REST_Posts_Controller::get_schema_links()Retrieves Link Description Objects that should be added to the Schema for the posts collection.
- WP_REST_Posts_Controller::handle_terms()Updates the post's terms from a REST request.
- WP_REST_Posts_Controller::prepare_item_for_response()Prepares a single post output for response.
- WP_REST_Posts_Controller::prepare_tax_query()Prepares the 'tax_query' for a collection of posts.
- WP_REST_Posts_Controller::prepare_taxonomy_limit_schema()Prepares the collection schema for including and excluding items by terms.
Show all 15
- WP_REST_Response::remove_link()Removes a link from the response.
- WP_REST_Server::get_routes()Retrieves the route map.
- _access_denied_splash()Displays an access denied message when a user tries to view a site's dashboard they do not have access to.
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.
Signature, return type and hooks compared across 5 parsed releases.
5.9.0
Converted into a wrapper for
wp_filter_object_list().from the docblock4.7.0
Uses
WP_List_Util class.from the docblock3.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.