Filter: bricks/filter_element/data_source_wcField
Filters the data source (options) specifically for WooCommerce field filters. This allows you to customize the options displayed for WooCommerce filters like product visibility, stock status, etc.
Parameters
Section titled “Parameters”$data_source(array): Array of filter options.$element(object): The filter element instance.
Example usage
Section titled “Example usage”add_filter( 'bricks/filter_element/data_source_wcField', function( $data_source, $element ) { // Example: Add a custom option to a WooCommerce filter // Note: You might need to check $element->settings to target specific WC fields if ( isset( $element->settings['sourceFieldType'] ) && $element->settings['sourceFieldType'] === 'stock_status' ) { // Modify stock status options }
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
Thanks for sharing feedback. We're using it to improve these docs.