Skip to content

Conversation

@n7studios
Copy link
Contributor

@n7studios n7studios commented Oct 24, 2025

Summary

When testing for WordPress 6.9 beta, two issues found:

Manually refreshing resources with an invalid/expired access token would result in no error message displaying
Tests EndToEnd RefreshResourcesButtonCest testRefreshResourcesErrorNoticeOnPageClassicEditor fail

A JS error in the browser console.
Screenshot 2025-10-24 at 17 22 07

This PR resolves by:

  • improving whether the block editor is active when editing a Page, Post or CPT, by using wp.editPost (only defined if the block editor is active) instead of wp.blockEditor (which in WordPress 6.9 beta is always defined, regardless of whether the block editor or Classic Editor is used)
  • only registering pre-publish actions when editing a Page, Post or CPT

Changes are in this PR vs. the 6.9 beta PR, to make sure no breaking changes are introduced for those still on the current public version of WordPress 6.8

Testing

Existing tests pass.

Checklist

@n7studios n7studios self-assigned this Oct 24, 2025
@github-actions
Copy link

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios n7studios requested review from a team, corydhmiller and noelherrick and removed request for a team October 27, 2025 01:16
@n7studios n7studios marked this pull request as ready for review October 27, 2025 01:16
@n7studios n7studios changed the base branch from tests-wp-rocket to main October 29, 2025 07:36
Copy link
Contributor

@noelherrick noelherrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a helper with a test so that readers can easily understand what you're trying to do by adding an explanatory name, and since wp.editPost doesn't seem to be an API for checking what you're checking, so a bit more subject to change, it would be nice to just update it one place.

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

Block Editor: Add `convertKitGutenbergEnabled` helper
@n7studios n7studios merged commit f89d234 into main Nov 5, 2025
@n7studios n7studios deleted the improve-block-editor-detection branch November 11, 2025 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants