CSS
PHP
Server-Side Best Practice
Register Custom Block Style
Add a "Fancy Border" style to the core Image block. This uses the modern server-side registration method, which only loads the CSS when the style is actually used on a page.
Live Preview
Integration Steps
1
Register in PHP
Add the PHP snippet to your functions.php file. This registers the style name is-style-fancy-border with WordPress.
2
Apply in Editor
Go to the Block Editor, select an Image block, and look at the "Styles" panel in the sidebar. You will see a new "Fancy Border" option.
Default
Fancy