Closed njwgh closed 10 hours ago
In 2.0, there is a new filter you can use that greatly simplifies the process.
For example, if you're using a theme like GeneratePress, you only need to add the button
class to the button.
So, you could do this:
add_filter( 'generateblocks_default_button_attributes', function() {
return [
'className' => 'button',
];
} );
Now, every time you add a Button to your pages, it will come with that class and no other local styles.
Description
In GB 1.9.1 if you sync button style with theme in functions.php with code as per here: https://docs.generateblocks.com/article/sync-gb-button-style-with-generatepress-theme/ (I have included border-radius as well in my functions.php) then your button is styled as per those values in the backend and appears the same on frontend. In GB1.9.1 these are my buttons backend: fontend
with GB2.0 (free version) you have two options for adding a button. The button block or a text block with button tag With the same button styles in customiser and same functions.php this is what it looks like backend: frontend:
So these issues:
Steps to reproduce
$defaults['button']['borderRadiusTopRight'] = '3'; $defaults['button']['borderRadiusTopLeft'] = '3'; $defaults['button']['borderRadiusBottomRight'] = '3'; $defaults['button']['borderRadiusBottomLeft'] = '3';
Expected behavior
I would expect both types of buttons to appear styled with defaults in backend and frontend