Repository navigation
Editorial Updates: Show the Apply Editorial Updates button when "Show template" is enabled - #1340
Conversation
… template" is enabled
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1340 +/- ##
==========================================
Coverage 85.05% 85.05%
Complexity 4836 4836
==========================================
Files 190 190
Lines 17971 17971
==========================================
Hits 15286 15286
Misses 2685 2685
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. If 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:
|
What?
Shows the "Apply Editorial Updates" button, and lets it refine the post's blocks, when "Show template" is enabled in the block editor.
Why?
With "Show template" on, the top level of the editor holds the template's blocks (header, title, Post Content, footer), and the post's own blocks sit inside
core/post-content. Editorial Updates read blocks with a top-levelgetBlocks(), so it found no blocks with linked Notes. The button stayed hidden, and running the updates would have found nothing to refine.How?
In
useEditorialUpdates.ts, both places that read blocks now usegetPostContentBlockContext():hasPendingNotes): passesselinto the helper, so the button also updates when "Show template" is toggled.runRefinement(): refines the blocks inside Post Content instead of the template's blocks.If a template has no Post Content block, the button stays hidden, because no blocks have linked Notes.
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Initial code skeleton; final implementation and tests were reviewed and edited by me.
Screencast
screencast.mov
Changelog Entry