Filter: bricks/filter_element/data_source_{filter_source}
Filters the data source (options) for a specific filter source. The {$filter_source} portion of the hook name should be replaced with the actual source name.
Built-in taxonomy, wpField, and customField sources are handled before this dynamic filter runs. Use this hook for custom filter sources that Bricks does not populate internally.
Parameters
Section titled “Parameters”$data_source(array): Array of filter options. Each option should be an associative array with keys likevalue,text,class, etc.$element(object): The filter element instance.
Example usage
Section titled “Example usage”// Populate options for a custom source 'my_source'add_filter( 'bricks/filter_element/data_source_my_source', function( $data_source, $element ) { $data_source[] = [ 'value' => 'option_1', 'text' => 'Option 1', ];
$data_source[] = [ 'value' => 'option_2', 'text' => 'Option 2', ];
return $data_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.