-
Notifications
You must be signed in to change notification settings - Fork 34
Description
WordPress 6.9 introduces a new feature, Notes, which allows users to leave block-level notes when editing content.
Under the hood, notes are just WP_Comments with the comment_type of note. The post association is made through the comment_post_ID field in each WP_Comment object/database, and a note is associated with a block through block-level metadata.
<!-- wp:paragraph {"metadata":{"noteId":3}} -->
<p>This is some text about the walk I took at the reservoir. </p>
<!-- /wp:paragraph -->
After cloning a post, the notes are not shown, but the metadata remains. WordPress Core does not currently strip out noteId metadata, and it prevents the user from adding new notes for the same block. I've created WordPress/gutenberg#73017 for this.
If the code is changed to always remove old, invalid metadata related to notes, then this bug can be closed. If the broken behavior is fixed and the metadata is left, removing it when a clone occurs could clean the block markup for the new post.
- I've searched for any related issues and avoided creating a duplicate issue.
Please give us a description of what happened
To Reproduce
Step-by-step reproduction instructions
- Create a new post using WordPress 6.9 (currently in beta3)
- Add a few blocks and Notes on the blocks.
- Clone the post.
- Open the new post in the editor and use the Code Editor.
Expected results
- The post does not have block-level metadata related to notes.
Actual results
- The block-level metadata remains.
Screenshots, screen recording, code snippet
If possible, please provide a screenshot, a screen recording or a code snippet which demonstrates the bug.
Technical info
- If relevant, which editor is affected (or editors):
- Block Editor
- Gutenberg Editor
- Classic Editor
- Other: