Open
Description
Description
contentOnly
mode is becoming more prevalent in the editor after 'Select Mode: Use the content-only behavior in select mode' was merged.
Lots of block types still aren't working perfectly in contentOnly
mode, so this list intends to capture those issues so that they can be worked on in parallel by multiple devs. Lots of the blocks also share similar issues, so hopefully there are higher-level solutions to the problems that can be found (lets discuss these in the comments).
Feel free to add more to this issue if you discover untracked issues.
Rough snippet that can be run in post editor's console to generate example blocks in contentOnly locked groups, YMMV 🤷
const blockExamples = wp.data.select( 'core/blocks' ).getBlockTypes()
.filter( ( { example } ) => example )
.map( ( { name, title, example: { attributes, innerBlocks } } ) => ( { name, title, attributes, innerBlocks } ) );
const createInnerExamples = ( innerBlocks ) => innerBlocks.map( ( { name, attributes, innerBlocks } ) => {
return wp.blocks.createBlock( name, attributes, createInnerExamples( innerBlocks ?? [] ) );
});
const createExamples = ( examples ) => examples.map( ( { name, title, attributes, innerBlocks } ) => {
const innerBlockInstances = createInnerExamples( innerBlocks ?? [] );
return wp.blocks.createBlock( 'core/group', {
templateLock: 'contentOnly',
metadata: { name: title }
}, [ wp.blocks.createBlock( name, attributes, innerBlockInstances ) ]);
});
const innerBlockInstances = createExamples( blockExamples );
const blocks = wp.data.select( 'core/block-editor' ).getBlocks();
wp.data.dispatch( 'core/block-editor' ).insertBlocks( innerBlockInstances, blocks.length );
Blocks
Buttons
- User cannot add/remove individual buttons (see Add new mode to
contentOnly
locking to allow insertion of new inner blocks #52018)
Cover
- Background image cannot be modified (should it be possible to modify this?)
- Initial block placeholder can't be interacted with in
contentOnly
mode (possibly the same issue as above).
Details
PR: #70124
- Details block appears as a single 'Paragraph' in the Inspector Content panel
File
PR: #65787
- Block is completely non-interactive, including the placeholder
Gallery
- Placeholder is non-interactive in contentOnly mode.
- Users cannot add/remove items (should they be able to?) (see Add new mode to
contentOnly
locking to allow insertion of new inner blocks #52018)
List
PR: #65836
- Users cannot add/remove list items from the list block or nest list items (how should nested list items appear in the Inspector content panel?) (see Add new mode to
contentOnly
locking to allow insertion of new inner blocks #52018) - List Items currently have a special case in the code to prevent them appearing in the Inspector Content panel (a more general solution to this should be found as other container blocks will have the same kind of problem for their inner blocks):
Media / Text
- Additional paragraphs can't be added in the content area of the block (similar to Quote)
- In the Inspector panel, the paragraph that's inside the Media Text block appears after it (again, similar to Quote)
More
PR: #70100
- User cannot edit 'Read more' text
Navigation
- Cannot be edited (see Navigation Block: develop a content-only representation #65699)
Post Title / Featured Image / Excerpt
- Blocks cannot be edited (they have no attributes suitable for the
role: content
declaration)
Query
Quote
- The paragraph that's inside the Quote appears after the Quote block in the Inspector Content panel (to repro, add a quote block inside a group, apply
contentOnly
templateLock to the group, and select the group.) - Users cannot add more paragraphs (should they be able to? If so should they also be able to add other types of blocks? How do these appear in the Inspector Content panel?) (see Add new mode to
contentOnly
locking to allow insertion of new inner blocks #52018)
Site Logo / Site Title / Site Tagline
PR: #67260
- Blocks cannot be edited (they have no attributes suitable for the
role: content
declaration)
Social Link(s)
- Social Link: Add contentOnly editing support #66622
- Allow editing individual link text. Should be button be refactored to use
<RichText />
? - Should social link block styles be shown in Write mode for each link or only the social links block container?
- Additional blocks cannot be added to Social Links (see Add new mode to
contentOnly
locking to allow insertion of new inner blocks #52018)
Synced Patterns in Write Mode
PR: #67026
Table
PR: #70114
- Block is completely non-editable in
contentOnly
mode, including the initial placeholder
Template Parts
- Template parts are unselectable in write mode, as they're not considered 'sections'. (see Template part selecting and editing unavailable in “Write” mode #66463)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Now