Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parent menu slug to add_submenu_page to avoid PHP 8.2 deprecation notices #135

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

claytoncollie
Copy link
Contributor

Description of the Change

This change fixes PHP 8.2 deprecation notices

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /Users/claytoncollie/www/10upexperience/app/public/wp-includes/functions.php on line 7053

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /Users/claytoncollie/www/10upexperience/app/public/wp-includes/functions.php on line 2165

Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/claytoncollie/www/10upexperience/app/public/wp-admin/admin-header.php on line 36

How to test the Change

  1. Create a fresh install of WordPress
  2. Clone repository and checkout branch
  3. Set WP_DEBUG and WP_DEBUG_DISPLAY to true
  4. Visit the wp-admin to look for the errors
  5. Make sure you can visit the about 10up screen --> http://localhost:10003/wp-admin/admin.php?page=10up-about

Changelog Entry

Fixed - Passing null as parameter 1. Define the parent menu slug when registering the submenu screen

Credits

Props @claytoncollie

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@pabamato
Copy link

I was about to report the same issue.
@darylldoyle this passed my tests (PHP 8.2 - WP 6.3.1)

@TylerB24890 TylerB24890 mentioned this pull request Oct 24, 2023
1 task
@darylldoyle darylldoyle merged commit a45064f into develop Oct 26, 2023
1 of 3 checks passed
@darylldoyle darylldoyle deleted the fix/admin-parent-slug branch October 26, 2023 11:54
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.

3 participants