Skip to content

Editor: Warn in Classic Editor when serialized block comments are present#11969

Open
wprashed wants to merge 17 commits into
WordPress:trunkfrom
wprashed:codex-ticket-65335-classic-editor-block-warning
Open

Editor: Warn in Classic Editor when serialized block comments are present#11969
wprashed wants to merge 17 commits into
WordPress:trunkfrom
wprashed:codex-ticket-65335-classic-editor-block-warning

Conversation

@wprashed
Copy link
Copy Markdown

@wprashed wprashed commented May 26, 2026

Adds a Classic Editor warning when post content contains WordPress block comment syntax (e.g. ), which may not be visible in the Visual tab. This helps prevent accidental overwrites when content appears empty visually but block markup still exists in Code view.

wprashed and others added 14 commits April 13, 2026 17:52
Introduce a native Performance settings screen with controls for page caching, asset minification, critical CSS, lazy loading, image optimization, and database cleanup.

Add core performance helpers for:
- registering and sanitizing optimization settings
- anonymous front-end page caching with cache invalidation hooks
- front-end HTML and inline CSS/JS minification
- critical CSS generation from inline styles
- lazy-loading controls through existing media filters
- AVIF/WebP output format preference when supported
- cache clearing and database cleanup actions

Wire the new screen into Settings, load the performance runtime during bootstrap, and add focused PHPUnit coverage for the new helpers.
…sent

Add a Classic Editor warning for posts/pages whose content contains WordPress block comment syntax (<!-- wp:... -->).

This helps prevent accidental overwrites when the Visual tab appears empty but block markup still exists in the Code tab. The notice is:

Scoped to the Classic Editor content field (#content).
Shown only when block comment markup is detected.
Inserted inline above the editor (#wp-content-wrap).
Guarded against duplicate rendering.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 26, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @1178653+wordpress-develop-pr-bot[bot]@users.noreply.github.com.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

Core Committers: Use this line as a base for the props when committing in SVN:

Props wprashed, ankitkumarshah.

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

@wprashed wprashed changed the title Codex ticket 65335 classic editor block warning Editor: Warn in Classic Editor when serialized block comments are present May 26, 2026
wprashed added 3 commits May 26, 2026 12:34
…s input

Prevent an undefined index notice by checking isset( $_POST['sidebars'] ) before is_array(), and add an AJAX unit test covering the missing sidebars request case.
@github-actions
Copy link
Copy Markdown

Trac Ticket Missing

This pull request is missing a link to a Trac ticket. For a contribution to be considered, there must be a corresponding ticket in Trac.

To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description. More information about contributing to WordPress on GitHub can be found in the Core Handbook.

@github-actions
Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@Infinite-Null
Copy link
Copy Markdown

Hey @wprashed, thank you for working on this! 😊

It looks like this PR is addressing the same issue. I had already opened a PR for this earlier; you can find it here: #11960

Would you mind taking a look at it? Happy to collaborate or discuss if you have any suggestions!

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