You aren’t defining any defaults in your registerBlockType
[...]
attributes: {
content: {
type: 'string',
default: 'I am a string',
},
},
[...]
Worth noting also that the attributes will only get saved in your final markup once they have a value – it won’t save the defaults in the content.
Related Posts:
- 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
- How to add custom table style for table block in gutenberg editor
- 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
- 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 do you debug plugins?
- Add multiple plugin directories
- What are the differences between WPINC and ABSPATH?
- Where do I put the code snippets I found here or somewhere else on the web?
- Delete WordPress plugin Repository
- Giving Multiple Authors Access to a Plugin’s WP.org Repo
- Add section (add_settings_section) to a custom page (add_submenu_page)
- Creating a default Custom Post Template that a Theme can override
- Load plugin selectively for pages or posts, etc
- Can i create two tables at single time while installation of custom plugin?
- How do I check if my $wpdb->insert() was successful?
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- How does WooCommerce display a custom comment_type in Comment Admin?
- Created Widget Not Showing up on Admin Panel
- How to display public user profile with 2 additional fields? (GitHub source code included)
- Action on post publish
- OOP: Display warning and deactivate the plugin if PHP version is less than 5.4
- wp_enqueue_scripts not working inside shortcode
- Handling jQuery Component Collision
- Scope for PHP Variables Assigned in functions.php or a plugin
- How to make a custom field as an editor in wordpress?
- Gutenberg: How to refresh ServerSideRender with useSelect and AsyncModeProvider true?
- How to keep users unique id stored in session in addition to IP in WordPress plugin?
- JS Support Ticket – Auto create WP account
- uninstall.php file in Plugin to clean DB
- How to get specific setting by settings_fields()?
- Save / Show multi line text in metabox
- Python with wordpress plugin
- Passing an array from shortcode-function to filter-function
- WP_Async_Task doesn’t appear to be running asynchronously
- TinyMCE Styles Dropdown not adding html tags other than span
- add_filter doesn’t work
- How can I insert thousands of Woocommerce products by batch with PHP? [closed]
- What are the Best Practises When Using AJAX in Plugin Development?
- Run function on plugin activation before plugin is loaded
- execute function after one completed
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- How to Resize the Custom Post Images?
- React error #231with Custom Blocks after upgrade to WP 5.5
- Why is it important to check for isset and is_array before checking in_array in this example?
- Upload files to the plugin menu
- How to call external functions from a PHP script in a WordPress plugin?
- Licensing a Plugin [closed]
- Add a function call after content automatically?
- Don’t load the theme for a page FROM a plugin EDITED
- WordPress Feed Creator Name Tag Full Name Instead Of First Name
- WordPress plugin with its own “site”/theme
- How to add custom function to pluggable.php
- Scrape key check failed. Please try again
- Add a new category for posts
- How to save Setting pages data to the database?
- Add hook after content without formatting
- Prevent WordPress from sending set-cookie http header
- admin_post hook not firing function inside class
- how to auto random increment for post view
- Woocommerce convert simple products to variations
- WordPress Thickbox Navigation Issue in Gallery
- Looking for Image Slider that is based on default WP Media Library
- How to save the option’s new values plus old value without overwrite old one
- Not displaying Woocommerce product page in lightbox
- WordPress “template_include” Filter Not Working
- WordPress Media Uploader : How to add custom button on featured image tab
- Change pricing in Woocommerce based on Category and Product [closed]
- Can we validate data from jquery
- Re-writing MySQl query for execute faster
- Getting error “The package could not be installed. PCLZIP_ERR_BAD_FORMAT ”
- Building a simple “settings” plugin to change textstrings on the home page
- My wordpress website admin panel loads very slow, what can i do about that? [closed]
- WordPress Customise
- register_activation_hook not working
- Predefine Product Variations for specific custom product type [closed]