Skip to content
Get Bricks

Filter: bricks/filter_element/count_source_wcField

Filter: bricks/filter_element/count_source_wcField

Section titled “Filter: bricks/filter_element/count_source_wcField”

Filters the count data specifically for WooCommerce field filters (e.g., price, rating). This allows you to customize the counts displayed next to filter options.

  • $count_source (array): Associative array where keys are filter values and values are their respective counts.
  • $element (object): The filter element instance.
add_filter( 'bricks/filter_element/count_source_wcField', function( $count_source, $element ) {
// Example: Hide counts for rating filter by setting them to 0 (if logic hides 0 counts)
// Or manipulate them for specific ratings
return $count_source;
}, 10, 2 );