関数 wp_filter_object_list()
定義ファイル :/blog/wp-includes/functions.php 14
wp_filter_object_list()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | /** * Filters a list of objects, based on a set of key => value arguments. * * @since 3.0.0 * * @param array $list An array of objects to filter * @param array $args Optional. An array of key => value arguments to match * against each object. Default empty array. * @param string $operator Optional. The logical operation to perform. 'or' means * only one element from the array needs to match; 'and' * means all elements must match. Default 'and'. * @param bool|string $field A field from the object to place instead of the entire object. * Default false. * @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 ) $list = wp_list_pluck( $list, $field ); return $list; } |