fix: use options.php as parent slug to avoid null page title deprecation#23039
Closed
YuF-9468 wants to merge 1 commit intoYoast:trunkfrom
Closed
fix: use options.php as parent slug to avoid null page title deprecation#23039YuF-9468 wants to merge 1 commit intoYoast:trunkfrom
YuF-9468 wants to merge 1 commit intoYoast:trunkfrom
Conversation
Fixes Yoast#22029 by passing a valid parent slug (`options.php`) instead of an empty string to `add_submenu_page()` calls. This prevents PHP 8.3 from throwing an E_DEPRECATED error when `strip_tags()` receives null from missing page title. Changes: - installation-success-integration.php: Change parent slug from empty string to options.php - settings-integration.php: Change parent slug from empty string to options.php - setup-url-interceptor.php: Change parent slug from empty string to options.php
Member
|
Closing as duplicate of #23003 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #22029.
This PR fixes the PHP 8.3 deprecation error
E_DEPRECATED: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecatedby using a valid parent slug (options.php) instead of an empty string inadd_submenu_page()calls.What changed
src/integrations/admin/installation-success-integration.php: Changed parent slug from''to'options.php'src/integrations/settings-integration.php: Changed parent slug from''to'options.php'src/dashboard/user-interface/setup/setup-url-interceptor.php: Changed parent slug from''to'options.php'Why this helps
When
add_submenu_page()receives an empty string as the parent slug, WordPress cannot determine the page title properly, leading to null being passed tostrip_tags(). By using'options.php'as a valid parent slug, WordPress properly renders the page title and the deprecation error is avoided.Testing
Risk
Minimal - only changes the parent slug parameter in
add_submenu_page()calls, which is specifically recommended in the issue comments as the correct fix.