Keep changes in defaults.php on plugin update?

After plugin updates, of course, defaults.php doesn’t keep changes.

In no “PRO plugin” is the following the right way to change default styles?

add_filter( ‘generateblocks_defaults’, function( $defaults ) {
$defaults[‘container’][‘paddingTop’] = ‘’;
$defaults[‘container’][‘paddingRight’] = ‘’;
$defaults[‘container’][‘paddingBottom’] = ‘’;
$defaults[‘container’][‘paddingLeft’] = ‘’;
return $defaults;
} );

How can I change the $container_width, and keep it after the update?

Thank you!

That filter is the right way to do it.

For the container width, check this out: Setting the default Container width

1 Like