[wp-trac] [WordPress Trac] #51254: includes/plugin.php remove_menu_page should check if $menu is array

WordPress Trac noreply at wordpress.org
Sat Sep 5 16:22:28 UTC 2020


#51254: includes/plugin.php remove_menu_page should check if $menu is array
----------------------------+------------------------
 Reporter:  kernelzechs     |       Owner:  (none)
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Administration  |     Version:
 Severity:  normal          |  Resolution:  duplicate
 Keywords:                  |     Focuses:
----------------------------+------------------------
Changes (by SergeyBiryukov):

 * status:  new => closed
 * resolution:   => duplicate
 * component:  Plugins => Administration
 * milestone:  Awaiting Review =>


Comment:

 Hi there, welcome to WordPress Trac! Thanks for the report.

 Just noting this was discussed a few times before, specifically in #23767
 and #19937.

 Adding an `is_array()` or `! empty()` check would remove the warning, but
 would also just hide the fact that calling the function the function too
 early or on an incorrect hook still doesn't work as expected.

 comment:1:ticket:23767 outlines a few scenarios where this warning can
 occur. All of them are developer errors, so the developer should see that
 something is wrong. Hiding the warning would just make debugging harder.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51254#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list