Skip to content
Get Bricks

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.

  • $attributes (array): Array of HTML attributes (e.g., class, data-popup-id).
  • $popup_id (int): The ID of the popup template.
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 );