Make WordPress Core

Opened 5 months ago

Last modified 5 months ago

#61479 new defect (bug)

Warnings when use remove_menu_page() with a non exist page.

Reported by: jose-lazo's profile Jose Lazo Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.5.4
Component: Administration Keywords: has-screenshots has-patch
Focuses: administration Cc:

Description

We use Sentry to track bugs in our project and when we use the doc function remove_menu_page() we receive numerous warnings for incorrect use of the foreach loop in the function.

https://postimg.cc/RqFDvr7D

It is necessary to check that each element of the global $menu contains a valid array.

Change History (2)

This ticket was mentioned in PR #6872 on WordPress/wordpress-develop by @narenin.


5 months ago
#1

  • Keywords has-patch added

#2 @narenin
5 months ago

Hi @jose-lazo

I also able to replicate the same.

Thanks for the detailed information regarding this. I have added the patch for this.

https://github.com/WordPress/wordpress-develop/pull/6872

Note: See TracTickets for help on using tickets.