WordPress.org

Make WordPress Core

Changes between Version 2 and Version 3 of Ticket #40651, comment 2


Ignore:
Timestamp:
05/04/2017 02:01:14 PM (3 years ago)
Author:
kellenmace
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #40651, comment 2

    v2 v3  
    1 Thanks for the recommendation, @melchoyce and for linking to the plugin, @westonruter. The Show Plugin Menu Items on Activation plugin was my solution to this issue. It essentially stores a copy of the global $menu and $submenu arrays before the plugin(s) is activated, then after it is activated, accesses those global arrays again and does a diff to determine which are the newly added menu items. It then shows admin pointers if there are 1-3 new menu items, or displays a notice stating that there are none (0) or many (4 or more). If this feature were rolled into core, I expect that both the process for determining which menu items are new and indicating the new ones would likely be different. But perhaps my plugin can serve as an example of how such a feature could work.
     1Thanks for the recommendation @melchoyce, and for linking to the plugin @westonruter. The Show Plugin Menu Items on Activation plugin was my solution to this issue. It essentially stores a copy of the global $menu and $submenu arrays before the plugin(s) is activated, then after it is activated, accesses those global arrays again and does a diff to determine which are the newly added menu items. It then shows admin pointers if there are 1-3 new menu items, or displays a notice stating that there are none (0) or many (4 or more). If this feature were rolled into core, I expect that both the process for determining which menu items are new and indicating the new ones would likely be different. But perhaps my plugin can serve as an example of how such a feature could work.
    22
    33I think if a feature like this were rolled into core, it may make sense to do it this way: