wp_list_filter() WP 1.0
Filters a list of objects, based on a set of key => value arguments.
Works based on: WP_List_Util()
No Hooks.
Return
Array. Array of found values.
Usage
wp_list_filter( $list, $args, $operator );
- $list(array) (required)
- An array of objects to filter.
- $args(array)
- An array of key => value arguments to match against each object.
Default: empty array - $operator(string)
- 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'
Changelog
Since 3.1.0 | Introduced. |
Since 4.7.0 | Uses WP_List_Util class. |
Code of wp_list_filter() wp list filter WP 5.6
function wp_list_filter( $list, $args = array(), $operator = 'AND' ) {
if ( ! is_array( $list ) ) {
return array();
}
$util = new WP_List_Util( $list );
return $util->filter( $args, $operator );
}Related Functions
From tag: array list help functions (sorting arrays objects)
More from category: Helper Functions
- __return_empty_array()
- __return_empty_string()
- __return_false()
- __return_null()
- __return_true()
- __return_zero()
- build_query()
- get_page_hierarchy()
- get_temp_dir()
- human_readable_duration()
- is_email()
- is_php_version_compatible()
- is_serialized()
- is_serialized_string()
- is_wp_version_compatible()
- map_deep()
- maybe_serialize()
- maybe_unserialize()
- path_join()
- seems_utf8()
- stripslashes_deep()
- timer_stop()
- urlencode_deep()
- wp_basename()
- wp_debug_backtrace_summary()
- wp_doing_ajax()
- wp_extract_urls()
- wp_generate_uuid4()
- wp_html_split()
- wp_is_json_request()
- wp_is_uuid()
- wp_json_encode()
- wp_kses_array_lc()
- wp_kses_hair()
- wp_kses_uri_attributes()
- wp_make_link_relative()