Filter: bricks/filter_element/count_source_{filter_source}
Filters indexed count data for a specific custom filter source. The {$filter_source} portion of the hook name should be replaced with the actual filterSource key, such as wcField or a custom source.
Built-in taxonomy, wpField, and customField sources are handled before this dynamic filter runs.
Parameters
Section titled “Parameters”$count_source(array): Indexed count rows. Each row can includefilter_value,filter_value_display,filter_value_id,filter_value_parent, andcount.$element(object): The filter element instance.
Example usage
Section titled “Example usage”add_filter( 'bricks/filter_element/count_source_wcField', function( $count_source, $element ) { foreach ( $count_source as &$row ) { if ( isset( $row['filter_value'] ) && $row['filter_value'] === 'featured' ) { $row['count'] = 999; } } unset( $row );
return $count_source;}, 10, 2 );Was this helpful?
A quick vote and short notes help us improve these docs faster.
Leave a note for us
Please do not include passwords, license keys, or personal data. We store submitted notes to improve the docs.
Thanks for sharing feedback. We're using it to improve these docs.