I was trying to figure this out all afternoon as well and figured out as well that the className is passed along by default in the save function for the root of
certain elements.
e.g. in the following code example where className is warning
return (
<div className="other-class-name" value={ props.attributes.content } />;
will return an element on the front end of
<div class="wp-block-block-name is-warning other-class-name">
https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#supports-optional has some more information
Related Posts:
- How to use get_theme_mod in gutenberg editor wordpress?
- Custom gutenberg block image preview not working
- Best approach to change mobile background image and adding its class
- Best collection of code for your 'functions.php' file [closed]
- similar of my posts in all over the internet sites and blogs [closed]
- How to structure a plugin
- How to implement a customizable free OpenID authentication?
- Should all plugins be encapsulated in a Class?
- What Features would you Most Like to See Added to WordPress? [closed]
- How can I edit post data before it is saved?
- is_plugin_active function doesn’t exist
- Difference between add_filter and apply_filters
- Custom pages with plugin
- Proper Way to Modify Plugin
- Delete tables from database when deleting plugin
- How can I delete orphan keys in WordPress database tables?
- Consuming an external API in WordPress?
- How to edit a wordpress plugin without break its update process
- How to delete all records from or empty a custom database table?
- Shared functionality in plugins and themes
- What is right way to go about adding functionality to a published WordPress plugin?
- Gutenberg disallow certain custom blocks but keep all core blocks?
- Validation error: Extending Gutenberg gallery block
- Looking for a Table of Contents (TOC) plugin for WordPress
- Remote upload file to server B
- WordPress Plugin Development In MVC Architecture, How?
- Is it a good idea to edit an already existing plugin to add more functionality?
- Checking if an attribute exists in a shortcode
- How Is Network Activate Different From Activate (by Implementation)?
- Creating Unique Post URLs for A/B Testing… Is this even possible?
- OpenID for WordPress 3.x? [duplicate]
- How can I import a class privately into a plugin?
- How to delete the Hello Dolly plugin automatically?
- Where should I use get_option in a plugin
- Get a button for in the Editor
- Show Similar Post Titles ( Similar to Stack Exchange )
- Plugin (or Theme) containing its own Plugins?
- Gutenberg: Error loading block: Invalid parameter(s): attributes but it can be used in the code
- How do I unlock a post programmatically?
- How to enable edit button in the theme’s customize UI?
- GPL and plugins
- How to disable Gutenberg editor?
- Getting a custom Gutenberg component’s state from outside that component
- How to create gutenberg block using REST API independently or as headless way?
- How do I extend one plugin I’m writing with another I’m writing using classes?
- Disable Specific Widgets on Selected Pages of a WordPress Website?
- How to create extendable wordpress plugins
- Delete Post With No Traffic?
- Create page when plugin is activated
- Automatically Creating Posts for Popular Forum Topics or Products [closed]
- Using Vagrant for customizable WordPress Multi-sites [closed]
- Generate custom output for page/URL in a plugin
- Open external links in a new window
- Show missing Sidebar from Gutenberg admin area
- Gutenberg: How to use output of php render_callback function in the block editors backend?
- Creating button next to “add media” that allows you to choose a single post
- WooCommerce create new product and add to cart on form submit
- Extending WC_Cart in woocommerce
- How can I limit functionality in one version of a plugin?
- Integrating plugins in themes
- Gutenberg: How to use block attributes with ServerSideRenderer?
- Some way to Flush or Overwrite all Imported Content in a Site for a Fresh Import – How?
- How to add usermeta to “Notice of Email Change” email message
- Which functions in theme or plugin load first
- WordPress Plugin as ‘Library’ From Abstract Application?
- How to show custom message once on plugin activation?
- What’s the recommended process for organising collaborative posting?
- Any way to use a custom Parameter for youtube embed without using an iframe?
- Post source link plugin – small modification
- How to add users roles dropdown in registration in wordpress
- Add CSS animation as Preloader to WordPress
- Custom comment type maybe?
- How to list the Hooks and order of execution in current loading page? [duplicate]
- wp_schedule_event / cron_schedules – custom recurrence time not working in Plugin
- Add custom meta box on Post page
- Posts wont expire
- How to load a new template page according to a particular URL?
- Custom Widget Creating PHP Exception When Placed In Its Own PHP File
- How to set value/term of a Woocommerce attribute text field in admin panel?
- WordPress network: set themes and plugins for new blog
- Updating post meta for custom post types
- Image Crop/Resize Function/Code Sinppet/Plugin to adjust/crop images during upload
- WP get_permalink Return Wrong URL
- Themes VS Plugins [duplicate]
- Failed to invoke other hook from the init hook
- WordPress 3.1 and Disqus throws Warning: number_format() error in Posts List
- Why is this custom taxonomy showing in the database?
- WP Plugin for Terms of Use
- How to edit plugin’s html? [closed]
- WordPress Plugin development Call to undefined function jQuery()
- Conditional Display of Links in Widgets
- How to add product images using script?
- Is there a plugin to display certain posts on certain pages? [closed]
- Woocommerce: Changing the variations select default value? [closed]
- Can a plugin add to header/footer/body content?
- Multiple plugins using the same OAuth class issues
- Automagic Link Shortening for Non-Hosted WP
- Gutenberg: Difference between “import” and “const” for dependencies
- Gurenberg Block: How to migrate from el-Functions to JSX elements?
- Created Widget Not Showing up on Admin Panel