The register_block_style
function is what you’ll want.
The basic implementation is
register_block_style(
'core/table',
array(
'name' => 'my-table-style',
'label' => 'My Table Style',
)
);
When you select the style, it will add the is-style-my-table-style
class to the block, which you can style using your style.css
or other stylesheet.
There are two other implementations, where you can declare an inline style or a whole stylesheet for that specific style. You can find more details in the documentation: https://developer.wordpress.org/block-editor/developers/filters/block-filters/#register_block_style
Related Posts:
- use WordPress theme / plugin editor in my plugin
- Passing select control value to block
- Passing RichText attributes to function onChange
- How do I store information in a dynamic block in WordPress?
- How to create custom embed block in gutenberg wordpress
- How to use get_theme_mod in gutenberg editor wordpress?
- How to add Internationalization in WordPress using Javascript/React?
- how to disable blockrenderAppender inside all Innerblocks?
- WordPress Gutenberg react make import of __experimentalUseInnerBlocksProps which is no more experimetal
- Using SVN to upload plugin created with gutenberg blocks
- Gutenberg Block Style CSS Class Is Not Applying on Backend
- Why is the ‘Gutenberg’ Plugin generating an ‘Inconsistent File Permissions’ error when other Plugins, with the same permissions, do not?
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Use a custom block in another block
- Gutenberg default attributes are empty when accessing in edit
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- Has blocks gutenberg block multiples registers type in my Plugin
- Fixed: Console.log twice in the edit function
- How to resolve warning for `unstableOnSplit` prop on a DOM element in block editor
- How to dynamically add template in Innerblock?
- Block content rendering on the top just below body tag
- Gutenberg: Dynamic Block – Show saved data in the editor
- Create plugin with multiple blocks
- How do I set register_meta for a specific CPT?
- How do I save meta key value in the save function?
- Update Content for a Custom Block Toolbar Button
- Wrong block appender button showing
- How to get custom setting from get_option and pass it in getEntityRecords in gutenberg block?
- Vanilla javascript in custom gutenberg block not working
- WordPress custom block: Link saved in database not retrieved when editing post
- How can I find plugins’ slug?
- My custom made plugin has “a new version available” which links to unrelated plugin
- wp.media update options and force render on uploader
- How to remove duplicate sub-menu name for top level menu items in a plugin?
- WordPress Plugin Development from Scratch. How? [closed]
- “Donate to this plugin” for WordPress.org Plugin Authors
- Disable text tab on WordPress text-editor
- How to show custom message once on plugin activation?
- How to fetch serialized data from wordpress options
- Passing URL parameters to WordPress pages and pretty url
- WordPress network: set themes and plugins for new blog
- How to get the custom page get_permalink?
- Plugin translations problem
- Advanced Custom Fields into functions.php
- How ( and mostly at what time ) can i prevent the alternate cron from running?
- What is the function to get plugin base url in multisite?
- PDF download – use wordpress functions
- WordPress register_activation_hook table creation not working
- API to filter new user registration $POST data?
- nonces in custom oop plugin
- Set cookie then immediantly refresh the page
- Wp die causing 500 Internal Server Error?
- Redirect to a welcome page after updating plugin
- Write to / remove from default .htaccess file from plugin?
- link bbpress forum discussion to blogposts
- How to inform the user that the save was not successful?
- php page not found for plugin options menu
- Re use the list table for a custom post type on another page
- Can we have an ‘Update metadata’ button in Image Gallery for all image instances?
- Create a plugin from within WordPress
- Class variables not correct on page
- WordPress Multisite: Programmatically Activate / Deactivate a Plugin of a Specific Blog
- composer not working on my plugin when i upload it to my website
- What is the WordPress approach to custom data?
- WordPress Fatal Errors [closed]
- YOAST Seo xmlsitemap menu item not showing in the dashboard [closed]
- Possible?? Pull Plugin Property Data to a Theme’s Custom Post Type
- How to rewrite URL and get the values?
- Disable plugin visibility at the plugin directory
- Plugin is creating posts twice
- How do I reliably find a URL to a script or other file?
- How to add captcha to publish widget
- How to add logo to a WordPress Custom Plugin?
- Widgets are not displaying in the admin panel
- How to overwrite the category template in a plugin
- Content-Security-Policy implementation with WordPress W3Total Cache plugin installed
- show wc_add notices on particular page in woo commerce custom plugin development
- How to write different events from different functions in my file to a log file in WordPress
- Create a form and have custom menu display based on user answers?
- How to make a plugin api route have permission?
- Function settings_fields() not recognized (Uncaught Error: Call to undefined function settings_fields())
- Why my multisite is this slow? (stats inside)
- what’s different between wpdb->prefix and table_prefix
- How to use custom footer template in a site-plugin?
- Problem with conditional woocommerce custom checkout field
- trying to create simple plugin to filter categories from all authors
- Change wp_mail SMTP settings for each E-Mail
- Proper Failure of Plugin Activation
- WordPress Thumbnail add action if no thumbnail
- How can I add the custom taxonomy categories to the posts and pages?
- Pass strings to plugin function [closed]
- Ajax in Plugins: returns the whole page
- How can I replace the built in WordPress editor?
- How to create a page template using custom plugin
- WordPress 3,5 and Jquery version
- how to search through plugin in wordpress cimy-user-extra-fields?
- add_meta_box showing blank screen in my page
- Use inline callable for hooks and filters
- Error in using ‘admin_enqueue_scripts’ action through a class
- How do i fix this error?