Filter: bricks/popup/attributes
Filters the HTML attributes of the popup container. This allows you to add custom classes, data attributes, or other attributes to the popup element.
Parameters
Section titled “Parameters”$attributes(array): Array of HTML attributes (e.g.,class,data-popup-id).$popup_id(int): The ID of the popup template.
Example usage
Section titled “Example usage”add_filter( 'bricks/popup/attributes', function( $attributes, $popup_id ) { // Example: Add a custom class to a specific popup if ( $popup_id === 1234 ) { $attributes['class'][] = 'my-custom-popup-class'; $attributes['data-custom-attr'] = 'value'; }
return $attributes;}, 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.