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
- Why is my Gutenberg block not saving and rendering the chessboard?
- How can we extent core/group or cover block?
- How to change the version of block.js and plugin to the same of Package.json?
- How do I apply different block supports to different parts of my custom block?
- Custom Gutenberg blocks not showing in WP editor
- Best way to initiate a class in a WP plugin?
- What Plugins Demonstrate Great WP Plugin Development? [closed]
- Why activate_plugin is not working in register_activation_hook
- Best Practice for Referencing the Plugin Directory
- Query Posts by Custom Field ‘Price’
- fatal error get_page_permastruct()
- WP WC CLI – WooCommerce setup store with wp-cli [closed]
- How to pass JavaScript variable to PHP in wordpress widget?
- Unable to add admin notice on plugin activation
- Shortcode display outside the div
- Pass $this to function nested in another public function of the same class
- Unable to load stylesheets and scripts to plugin settings page
- Correct way to use register_activation_hook
- Licensing of freemium plugin
- Way to hook into a sidebar call to replace it with a custom sidebar
- How to trigger an action with a URL
- Default Plugin Settings Not Writing to Database
- Create a custom page template inside my wordpress plugin
- How to pull code snippet from functionality plugin?
- Best approach to fetch data from wp options to js file or php file
- Is it possible to create Custom Post plug-in?
- why doesn’t this update part of this plugin work? it take me to nothing here page
- creating html reusable blocks via shortcodes
- I want to auto populate data in three fields if one drop down is selected
- How does task scheduler plugin implements cron that is not dependent on page load request? [closed]
- Session destroyed on page redirect
- Can I load the textdomain before a plugin is activated?
- Inject HTML meta tag inside wordpress tag using add_shortcode
- How to create WordPress custom end point with multiple parameters?
- How to redirect to same page after form submission
- plugin dev – minimum base css specificity?
- I changed font of wordpress dashboard but it is slow!
- Creating a functionality plugin to edit seriously simple podcasting
- How to add credit card validation check to wordpress [closed]
- Apply html elements in php statement
- How can i export and import my plugin option WordPress
- Remove all messages, when untrash a post
- Why won’t wp_enqueue_script work within any plugin file?
- Help to Create a Simple Plugin to make a post
- Error using wordpress functions inside a plugin class
- Rename a folder via HTML POST request
- add tags to wordpress post using REST API
- path of wp-content directory when we are on some plugin
- how to do Thematic like this website using wordpress?
- Add Custom Field to Post Pages via Plugin
- Timing issue with is_amp_endpoint()
- Is it possible to change plugin’s Admin Panel Url?
- Can I add content before post content without using the_content filter
- Why is the WordPress update_option not working in this code?
- what is the best way to create a premium plugin while also protecting your code
- hide load more button if there are no posts left to display
- Input gets deleted/overwritten after changing to different Admin Menu
- Force Network Activated Plugin to Run After Site Level Plugins
- I want to add facility to add country, State, City in my custom plugin
- How to set the default options on an existing plugin in a WP MU new user install
- Plugin Breaking WordPress Login
- Cannot Search | Featured | Popular | Newest | Favorites in wordpress working
- WP-Snap too slow (caused by WP_Query?)
- Checking url from plugin [duplicate]
- php include returns 1 as output with other outputs [closed]
- How to create a custom wordpress plugin for a specific functionality?
- How to save mediaupload multiple URLs as array meta?
- is_user_logged_in() undefined at shutdown in plugin context
- What are Seeds? [closed]
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode
- Force post update with React