Filter: bricks/popup/attributes
Filter: bricks/popup/attributes
Section titled “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 page helpful?