Skip to main content
Login Join
Snippet · PHP

Register Custom Gutenberg Block Style

Shared by Darshit Rajyaguru · June 16, 2026 · @init

36 views
Back to Snippets

Adds a custom style option to Gutenberg blocks.

add_action( 'init', function () {
        register_block_style(
            'core/button',
            array(
                'name'  => 'glass',
                'label' => 'Glass Button',
            )
        );
    }
);
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments