Filter: bricks/filter_element/filtered_source
Filters the data retrieved from the index representing the available filter options and their counts based on the current query results.
Parameters
Section titled “Parameters”$filtered_source(array): Associative array where keys are filter values and values are their respective counts (based on the current filtered query).$element(object): The filter element instance.
Example usage
Section titled “Example usage”add_filter( 'bricks/filter_element/filtered_source', function( $filtered_source, $element ) { // Example: Ensure a specific value is always present with a count of 0 if missing if ( ! isset( $filtered_source['some_value'] ) ) { $filtered_source['some_value'] = 0; }
return $filtered_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.