Unlock Hidden Power: 6 Little-Known Ways to Master Custom Block Styles in WordPress
style_data
: Atheme.json
-like object used to generate CSS.inline_style
: Inline CSS code that registers the CSS class required for the style.style_handle
: The handle of a previously registered style to enqueue alongside the block style.
See the documentation for register_block_style()
for more information.
3a. Use the style_data
parameter
- Best for: Plugin developers and theme developers
- Where you would typically use it: In plugin files or
functions.php
- Version requirements: WordPress 6.6 or higher
Although block styles have been a fundamental way that WordPress works since 5.0, the style_data
parameter was added in WordPress 6.6.