[wp-trac] [WordPress Trac] #32422: add_menu_page() returns incorrect $hookname when using plugin filename as $menu_slug

WordPress Trac noreply at wordpress.org
Wed Nov 11 00:03:51 UTC 2015


#32422: add_menu_page() returns incorrect $hookname when using plugin filename as
$menu_slug
--------------------------+------------------------------
 Reporter:  quinncom      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Plugins       |     Version:  4.2.2
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  administration
--------------------------+------------------------------

Comment (by johnjamesjacoby):

 [https://core.trac.wordpress.org/attachment/ticket/32422/32422.1.patch
 32422.1.patch] introduces the following changes:

 * Remove the `-network` & `-user` appending bit in `class-wp-screen.php`
 `WP_Screen::get()`
 * Append `-network` or `-user` in `get_plugin_page_hookname()` instead

 This assumes `get_plugin_page_hookname()` is not contextually strict, and
 might be a problem if you use it in the site context in the network admin.
 In this case, the `-network` suffix is added via a not-network-specific
 hook. Now that I mention it, this might already happen but inversely the
 way the code is today.

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


More information about the wp-trac mailing list