Repository navigation
Comments Title & Comments Form: Remove anchor support that conflicts with their fixed IDs - #86801
yashjawale wants to merge 5 commits into
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the |
|
Thanks for the fix. I tested previously saved The test used a synthetic post and approved comment with PHP 8.4.27 via WebAssembly and SQLite. It did not run the full Gutenberg plugin, editor or browser. A regression test using saved anchors could preserve this behavior. |
|
Thanks! |
What?
Closes #86800
Removes anchor support from the Comments Title and Comments Form blocks.
Why?
#74183 added anchor support to both, but they already output an
idon the same element (id="comments"from #40419, andid="respond"fromcomment_form()). The anchor creates a duplicateid, and browsers ignore it, so it has never worked.The anchor can't replace these IDs either:
#commentsis linked to byget_comments_link(),comments_popup_link()and the Comments Count Link block, and#respondis used byget_comments_link()andcomment-reply.jsto move the form when replying.How?
Removes
"anchor": truefrom bothblock.jsonfiles and regenerates the block docs. Existing anchors are ignored on render, so perhaps no deprecation is needed...?The parent Comments block's anchor can be used instead.
Testing Instructions
id(comments/respond), including in templates that already had an anchor saved.Screenshots or screencast
Before
After
Use of AI Tools
Assisted by Claude Code, all changes reviewed & tested manually.