Skip to content

fix: use options.php as parent slug to avoid null page title deprecation#23039

Closed
YuF-9468 wants to merge 1 commit intoYoast:trunkfrom
YuF-9468:fix-null-page-title
Closed

fix: use options.php as parent slug to avoid null page title deprecation#23039
YuF-9468 wants to merge 1 commit intoYoast:trunkfrom
YuF-9468:fix-null-page-title

Conversation

@YuF-9468
Copy link
Copy Markdown

@YuF-9468 YuF-9468 commented Mar 2, 2026

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 deprecated by using a valid parent slug (options.php) instead of an empty string in add_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 to strip_tags(). By using 'options.php' as a valid parent slug, WordPress properly renders the page title and the deprecation error is avoided.

Testing

  • Visited the affected pages on PHP 8.3 and confirmed the deprecation error is gone
  • Verified that page functionality remains unchanged

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.

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
@Djennez
Copy link
Copy Markdown
Member

Djennez commented Mar 2, 2026

Closing as duplicate of #23003

@Djennez Djennez closed this Mar 2, 2026
@YuF-9468 YuF-9468 deleted the fix-null-page-title branch March 3, 2026 08:46
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.

E_DEPRECATED: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated

3 participants