Skip to content
Get Bricks

Filter: bricks/theme_styles

Filters the array of Theme Styles loaded from the database. This allows you to modify, add, or remove Theme Styles programmatically.

  • $styles (array): Associative array of Theme Styles, where the key is the style name and the value is an array of style data.
add_filter( 'bricks/theme_styles', function( $styles ) {
// Example: Add a default property to all theme styles
foreach ( $styles as $key => $style ) {
if ( ! isset( $styles[ $key ]['settings']['typography'] ) ) {
$styles[ $key ]['settings']['typography'] = [ 'font-size' => '16px' ];
}
}
return $styles;
} );