Skip to content

Editorial Updates: Show the Apply Editorial Updates button when "Show template" is enabled - #1340

Merged
dkotter merged 1 commit into
WordPress:developfrom
yogeshbhutkar:fix/editorial-updates-show-template-mode
Nov 10, 2026
Merged

dkotter merged 1 commit into
WordPress:developfrom
yogeshbhutkar:fix/editorial-updates-show-template-mode

Conversation

@yogeshbhutkar

@yogeshbhutkar yogeshbhutkar commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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-level getBlocks(), 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 use getPostContentBlockContext():

  • Button visibility (hasPendingNotes): passes sel into 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

Fixed - The "Apply Editorial Updates" button being hidden, and refinement finding no blocks, when "Show template" mode is enabled in the block editor.

Open WordPress Playground Preview

@codecov

codecov Bot commented Nov 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.05%. Comparing base (d1a9bf4) to head (ab8d865).

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           
Flag Coverage Δ
unit 85.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yogeshbhutkar
yogeshbhutkar marked this pull request as ready for review November 10, 2026 05:34
@yogeshbhutkar
yogeshbhutkar requested a review from a team November 10, 2026 05:34
@github-actions

Copy link
Copy Markdown

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.

Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@dkotter dkotter added this to the 1.6.0 milestone Nov 10, 2026
@dkotter
dkotter merged commit 0bbe9f3 into WordPress:develop Nov 10, 2026
38 checks passed
@yogeshbhutkar
yogeshbhutkar deleted the fix/editorial-updates-show-template-mode branch November 11, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants