Make WordPress Core

Opened 17 months ago

Closed 16 months ago

Last modified 15 months ago

#57918 closed defect (bug) (fixed)

"Deprecated" on the Appearance Menu page of the classic theme.

Reported by: nendeb55's profile nendeb55 Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.2.1 Priority: normal
Severity: normal Version:
Component: Menus Keywords: php81 has-patch fixed-major
Focuses: administration Cc:

Description (last modified by sabernhardt)

WordPress6.2 RC1-55510
PHP8.1.6
Theme Twenty Twenty-One

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in D:\xampp\htdocs\wp620\wp-admin\includes\plugin.php on line 2088

Deprecated does not appear in PHP 8.0.

Attachments (1)

57918.diff (349 bytes) - added by SergeyBiryukov 17 months ago.

Download all attachments as: .zip

Change History (14)

#1 @costdev
17 months ago

  • Component changed from General to Plugins
  • Keywords reporter-feedback added

Hi @nendeb55, thanks for opening this ticket.

Are you running any plugins? This might be caused by a call to add_menu_page() or add_submenu_page() with $menu_slug set to null, for example.

Try disabling any plugins and see if the issue is gone. If not, can you confirm whether this issue occurs in WordPress 6.1.1?

#2 @nendeb55
17 months ago

I get the same "Deprecated" on WordPress 6.1.1.
I don't use any plugins.。

#3 follow-up: @costdev
17 months ago

  • Keywords php81 added; reporter-feedback removed

Thanks @nendeb55!

@SergeyBiryukov Looks like this is similar to #57578 - same deprecation, but a different screen.

@audrasjb While not introduced in 6.2, is this something we should try to resolve during the 6.2 cycle as we did with #57578 (i.e. an incomplete fix for Core passing null)?

Last edited 17 months ago by costdev (previous) (diff)

#4 @costdev
17 months ago

  • Version trunk deleted

As this also occurs on WordPress 6.1.1, I'm removing trunk as the Version to clear Report 40.

#5 @audrasjb
17 months ago

I'd target 6.2.1, we're a bit late in the release cycle and it's not a fatal, but only a deprecation warning.

#6 in reply to: ↑ 3 @SergeyBiryukov
17 months ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 6.2.1

Hi there, thanks for the ticket! I was able to reproduce the issue on a clean install.

Replying to costdev:

Looks like this is similar to #57578 - same deprecation, but a different screen.

Good catch, the fix indeed looks similar to [55263].

57918.diff resolves the notice in my testing, see comment:2:ticket:57578 for a deeper investigation.

Last edited 17 months ago by SergeyBiryukov (previous) (diff)

#7 @sabernhardt
17 months ago

  • Component changed from Plugins to Menus
  • Description modified (diff)

#8 @SergeyBiryukov
17 months ago

  • Focuses administration added

#9 @SergeyBiryukov
17 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 55552:

Administration: Define the $title global on the Menus screen for classic themes.

This brings more consistency with other screens and avoids a PHP warning in get_plugin_page_hookname():

preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Follow-up to [13257], [13366], [55263].

Props nendeb55, costdev, SergeyBiryukov.
Fixes #57918.

#10 @SergeyBiryukov
17 months ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 6.2.1 consideration.

#11 @costdev
16 months ago

#57974 was marked as a duplicate.

#12 @SergeyBiryukov
16 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 55639:

Administration: Define the $title global on the Menus screen for classic themes.

This brings more consistency with other screens and avoids a PHP warning in get_plugin_page_hookname():

preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Follow-up to [13257], [13366], [55263].

Props nendeb55, costdev, SergeyBiryukov.
Merges [55552] to the 6.2 branch.
Fixes #57918.

#13 @SergeyBiryukov
15 months ago

#58283 was marked as a duplicate.

Note: See TracTickets for help on using tickets.