apply_filters( 'ep_facet_meta_values_with_count', $values, $meta_field, $instance ) → {array}
Filter meta values, their labels, and count.
If you need to display a value with a different label:
add_filter(
'ep_facet_meta_all_values',
function( $values, $meta_field ) {
if ( 'my_field' !== $meta_field ) {
return $values;
}
if ( isset( $values['unreadable_value'] ) ) {
$values['unreadable_value']['name'] = 'My Readable Value';
}
return $values;
},
10,
2
);
Parameters:
Name | Type | Description |
---|---|---|
$values |
array | Values with names and counts |
$meta_field |
string | Meta field |
$instance |
array | Block info |
- Since:
- 4.3.0
- Source:
Returns:
New values
- Type
- array