GenerateBlocks button theme style inheritance

A really important tip, I picked up from the GeneratePress forums.

As you may know, the default GenerateBlocks button applies its own custom color styling when first inserted without taking into account the Customizer color settings.

Adding some custom PHP will solve the issue and apply the Customizer settings. Every button you add from now on, will use the GeneratePress Customizer settings and they should automatically update if updated from the Customizer.

add_filter( 'generateblocks_defaults', function( $defaults ) {
    $color_settings = wp_parse_args(
        get_option( 'generate_settings', array() ),
        generate_get_color_defaults()
    );

    $defaults['button']['backgroundColor'] = $color_settings['form_button_background_color'];
    $defaults['button']['backgroundColorHover'] = $color_settings['form_button_background_color_hover'];
    $defaults['button']['textColor'] = $color_settings['form_button_text_color'];
    $defaults['button']['textColorHover'] = $color_settings['form_button_text_color_hover'];
    $defaults['button']['paddingTop'] = '10';
    $defaults['button']['paddingRight'] = '20';
    $defaults['button']['paddingBottom'] = '10';
    $defaults['button']['paddingLeft'] = '20';

    return $defaults;
} );