Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#61479 new defect (bug)

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

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

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.


2 years ago
#1

  • Keywords has-patch added

#2 @narenin
2 years 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.