In general you have to do those things:
- Define you attributes
- Write a UI for the editor in the edit function, which saves values entered by the editor to your attributes
- Render the html with the save function by using the values from your attributes
The tutorial from the official docs isn’t half bad:
https://wordpress.org/gutenberg/handbook/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type/
Related Posts:
- lodash dependency in a Gutenberg plugin
- creating elements/innerblocks via rangecontrol
- Looking for callback function after Gutenberg is rendered?
- Gutenberg: useDispatch is not a function – @wordpress/data included
- Gutenberg – What is the best way to save/update post meta?
- How to prevent UNDO on guternberg block editor
- Do I have to worry about useState causing a re-render?
- Creating a custom Gutenberg block with columns
- Gutenberg: import dependency or assign from global variable?
- How to control an elements classes from multiple Gutenberg sidebar controls?
- Developing the save function in Gutenberg blocks
- Gutenberg – is it ok to load dependencies multiple times?
- Preventing double loading JS scripts (like React) when developing for Gutenberg
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- Trigger function on Remove block or add new block in Gutenberg JavaScript
- Rerender core Templates with with ToggleControl but it doesnt recognize block type
- HTMLCollection not counting right in editor? / for loop not working on elements in DOM
- What happens/fires when you select a block in the editor?
- Is “document loaded” different on admin side than public side?
- How to use setAttributes outside of the edit function return
- why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function
- Reading plugin settings in esnext wordpress block
- How can i add insertion point between inner blocks in my custom block like core blocks
- Reinitiate Gutenburg’s blocks using javascript
- Is it possible to reuse wp.media.editor Modal for dialogs other than media
- check if Gutenberg is currently in use
- How to use PanelColorSettings in custom Gutenberg block?
- How to provide translations for a WordPress TinyMCE plugin?
- Hook the Keydown Event in the TinyMCE Post Editor
- How to save block attributes when the output doesn’t change
- How to remove unwanted panels inside InspectorControls from core blocks in Gutenberg
- Gutenberg ServerSideRender is deprecated, how to work with new wp.serverSideRender component?
- Create Element From Dynamic HTML String [closed]
- How to Parse an Array of Elements in Gutenberg Block
- Can’t get JS code to work with shortcode
- Using the component outside the editor. select(‘core’) is null
- Gutenberg is there a way to know if the current block is reusable?
- How to allow core Gutenberg blocks selection only when you are inside a custom inner block
- How do I add a javascript file to all admin pages via a plugin?
- Saving data from block editor to the database
- How do I store information in a dynamic block in WordPress?
- Print WordPress username id inside JavaScript
- Mixing Regular Javascript With jQuery in a Plugin
- How to create multiple Gutenberg blocks in one plugin
- How to get color name in PanelColorSettings in custom Gutenberg block?
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- Where to call wp_enqueue_script in a plugin with custom template?
- Gutenberg Block showing invalid content on edit
- WordPress Plugin with a shortcode that dynamically generates javascript. Can I use add_action without wrapping the javascript in a function?
- Is there an additional block.json property to set to get an InnerBlocks child to respect the “supports” property?
- How to setAttributes in Gutenberg block?
- How to override gutenberg paragraph block edit property
- What’s the right way to instantiate new blocks and/or the plugin itself in toto when using wppb architecture?
- “import declarations may only appear at top level of a module” when importing WooCommerce API node module
- How can I get the selected string when using a toolbar button in Gutenberg?
- jQuery selectors for editor elements safe to use?
- wp.template() returns tags in Ajax response
- add javascript files only when plugin is called?
- How can I avoid conflicts between plugin and theme?
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- How to add a gradient component to a custom block
- How to only load css for used blocks on frontend
- Additional classes `undefined` after saving post in Gutenberg
- How do you submit a Gutenberg plugin?
- Translate javascript with WordPress built-in localization API for static strings
- Invalid hook call on save, not edit when using swiper slider
- Insert Into Post Not Working For Audio File Using jQuery
- Modify custom block plugin without losing content
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- How to override supports of innerBlocks?
- wp.media libary pdf type
- When setting styles to an extended block that was saved as a pattern, it doesn’t remove the style that was there
- extraprops override existing props
- Multiple TinyMCE on button click is initialized and appended but why only last one is writeable?
- WPGut – Updating failed and shortcode?
- Fixed: Console.log twice in the edit function
- Gutenberg – Call google map render function in save after DOM has been rendered
- converting a node.js project into a wp plugin
- How to re-render inspector controls?
- Load script on frontend from widget plugin
- WordPress with React: Saving and Using Data Collected with fetch
- How to integrate plugins into block editor
- Add custom html classes to gutenberg wrapper
- How to create save function for custom Gutenberg style block?
- Using JavaScript in WordPress page to call for server data using AJAX
- Uncaught ReferenceError: kpoejy is not defined
- On one of my sites a file is shown as 404 but the file IS there
- Gutenberg and custom blocks messed up pagespeed score. What did I wrong?
- Gutenberg text field validation
- Undo operation not working in Rich text [Gutenberg]
- How to get the value entered in the input field in wordpres
- Help interpreting @wordpress/create-block-tutorial-template usage error
- How can create a custom plugin to call my webapi after any registration or membership plugin functionality
- How can I add a custom button to the post editor?
- Block Development: hamburger module throwing error in save function
- Insert meta-description into Yoast-SEO input-field via JavaScript
- Adding a navigation with wp_nav_menu() to a custom block in the site editor
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?
- REST API error in block editor for custom templates
- Set srcset on a block image