Skip to content

fix: give the edit snippet screen its page title - #603

Merged
lightbulbman merged 3 commits into
core-betafrom
hotfix/edit-screen-title/core
Oct 19, 2026
Merged

lightbulbman merged 3 commits into
core-betafrom
hotfix/edit-screen-title/core

Conversation

@TallblokeUK

Copy link
Copy Markdown
Contributor

On PHP 8.1 and later, opening an existing snippet in the editor logs Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in wp-admin/admin-header.php on line 41. The browser tab also has no page title on that screen.

Reported at https://wordpress.org/support/topic/update-to-4-0-0-deprecated-strip_tags-passing-null-to-parameter-1/

Cause

WordPress looks up a screen's title in the admin menu. Since 4.0.0 the Edit Snippet page is registered outside the menu, so no title is found, and the admin header passes null to strip_tags().

Changes

  • The edit screen sets its title when it loads. The Add New and other Snippets screens are unaffected.

Verification

  • Reproduced on 4.0.0 (PHP 8.1): one notice when editing an existing snippet and none on the other Snippets screens. With the change there is no notice, and the tab reads "Edit Snippet".
  • A new test in Edit_Menu_Test checks the title WordPress resolves for the edit screen. It fails without the change.
  • The full PHPUnit suite passes and lint:php is clean.

@TallblokeUK TallblokeUK added the run-tests Trigger automated tests label Oct 18, 2026
@lightbulbman
lightbulbman changed the base branch from core to core-beta October 19, 2026 13:29
@lightbulbman
lightbulbman merged commit 7d1ba3e into core-beta Oct 19, 2026
15 checks passed
@lightbulbman
lightbulbman deleted the hotfix/edit-screen-title/core branch October 19, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-tests Trigger automated tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants