You can use the Gutenberg Block Template it is used to have a content placeholder for your Gutenberg content.
https://developer.wordpress.org/block-editor/developers/block-api/block-templates/
<?php
function myplugin_register_template() {
$post_type_object = get_post_type_object( 'post' );
$post_type_object->template = array(
array( 'core/image' ),
);
}
add_action( 'init', 'myplugin_register_template' );
Related Posts:
- Remove block styles in the Block Editor
- Are there ways to make the Gutenberg editor wider? And the HTML-block higher?
- Blocks: set a default value for a TextControl
- Is there a list / reference for all current native WordPress blocks?
- Setting default font family with theme.json
- (Gutenberg Block Editor) Using editor.BlockEdit filter, need to alter html/ CSS class of BlockEdit Component
- Extending Gutenberg group block: How to properly combine multiple attributes?
- Required (mandatory) Gutenberg block
- Add classname to Gutenberg block wrapper in the editor?
- How to develop custom blocks without triggering validation errors
- get selected categories or tags (using javascript) in GutenBerg?
- Help with using getBlockIndex
- Gutenberg blocks – processing server data within a block
- Best practices for CPT without using an editor [closed]
- Custom Gutenberg block is not showing up in inserter dialog
- Gutenberg – Custom blocks onClick not working?
- Get blocks from other pages, from within current page
- Your site doesn’t include support for the block… after registering a block
- .editor-styles-wrapper overriding my block styles in Gutenberg
- Remove a component fill from a Block Editor panel
- How to wrap the Gutenberg editor in a custom React component?
- Proper way to reload or update getEntityRecords state
- Cannot embed YouTube video
- Add a button to the toolbar of an existing Gutenberg block
- JSON File in Gutenberg
- Show date post published in Gutenberg component
- How to add a class to the element in a custom Gutenberg block
- Gutenberg: How to check if a block is used in a paginated post?
- Editor API Endpoint or Data Store That Provides a List of Meta Fields for Post Types
- Specify exact parent child relationship between two blocks
- Using custom Entities to retrieve external data in the Block Editor
- Block Validation Fails: ‘
- Insert SVG code (not img) in HTML block
- How to enable Block Editor on the Posts page
- React to a change of the block alignment
- Object type for block Attribute (Gutenberg)
- Controlling the RichText component outside of blocks
- Custom Gutenberg Block: How to return plain HTML with save(), without escaping?
- Removing advanced section from brand new gutenberg block
- How to allow to add gradients to core/heading block?
- Gutenberg: How to update associated Terms of Custom Taxonomy to Current Post
- Guttenberg Implementation on Front Page
- Register multiple styles / scripts in register_block_type
- How to automatically remove noreferrer from targetd link rel attribute, on render?
- Should there be concern about breaking Gutenberg updates to extended core blocks?
- How do I access onMerge, onReplace, onRemove functions for a Rich Text component in Gutenberg block code?
- How can Reusable Blocks be fully deleted?
- Make a Gutenberg Block that do WP_User_Query
- Extend Gutenberg block core/quote block
- How to get all attributes of a block in PHP?
- reload the gutenberg editer on taxonomy change
- Gutenberg Block Get Author Details
- Gutenberg Block Toolbar – remove button
- WordPress block editor embeds not working in theme (single.php)
- Cannot enable Gutenberg editor [closed]
- Remove ‘type / to choose a block’ placeholder [duplicate]
- Start a line with – without converting to list
- Quickest way of developing custom Gutenberg Blocks
- gutenberg attributes
- How to register two blocks in the same plugin
- Gutenberg: always show text color selector in editing bar
- How to lock innerBlocks within a block variation?
- How to get startIndex and endIndex from the selected block in gutenberg?
- How to fix: “The editor has encountered an unexpected error”?
- Set a minimum and maximum limit of images to select in the MediaUpload component for Block
- Compile a blocks src directory and main index.js entry file and output to different build dirs?
- Proxy External API request in PHP from Edit.js in Block Plugin
- How do I stop a dynamic Gutenberg component from re-rendering on every keystroke?
- How to Analyze Blocks and find Intersection and patterns between pages
- WordPress does not hide content after “Read more” block added using gutenberg editor
- Gutenberg InnerBlocks allowed types and reusable blocks
- Issue with translation – Gutenberg
- RSS feed WP widget vs Gutenberg Block?
- Gutenberg editor failing to load correctly after new theme install
- Gutenberg Custom Style problem with background image
- Theme options missing from edit page
- How to activate a new prop that a block introduces in a new release?
- “Updating failed” if any text includes “$v()”
- Disable Font Size for Authors using: add_theme_support(‘disable-custom-font-sizes’);
- Multiple checkboxes Gutenberg control
- Block validation failed
- Loading column block style seperately
- wp-scripts start build hangs
- How to use react in frontend of dynamic blocks?
- How to use isSavingNonPostEntityChanges in the same scope correctly?
- Attempting to specify viewScript, in a custom block, results in a register_block_script_handle error
- What is the standard way to use the version of React that ships with Gutenberg on the front end?
- Restricting core block nested blocks
- Is is possible to use Templates with blockprops?
- How to add readable name and description to templates?
- Errror generated in console leading to block validation failer
- Add Custom Block Supports to Core Block
- Block validation failed – save content vs post body content
- How to propegate changes from block render_callback to other blocks using that callback?
- wordpress 6.2 is alignfull and lignwide removed?
- How to add “rel=nofollow” for links in latest version of WordPress?
- I can’t highlight/select text in the RichText components in my Gutenberg blocks
- Lazy load video block while keeping autoplay
- Where’s the Block Template Feature in WordPress?
- Is it possible to add custom Components in the InspectorControls to the new “Styles” Tab?