[wp-trac] [WordPress Trac] #40651: Plugins: Make it easier to find plugin settings after install
WordPress Trac
noreply at wordpress.org
Wed May 3 20:35:42 UTC 2017
#40651: Plugins: Make it easier to find plugin settings after install
-----------------------------+---------------------------------
Reporter: melchoyce | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version:
Severity: normal | Resolution:
Keywords: | Focuses: ui, administration
-----------------------------+---------------------------------
Comment (by kellenmace):
Thanks for the recommendation, Mel and for linking to the plugin, Weston.
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 non/many (more
than 4). 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.
I think if a feature like this were rolled into core, it may make sense to
do it this way:
* Add an action inside of the add_menu_page() and add_submenu_page()
functions that captures and saves the original data as each menu item is
added.
* Hook a function to an action hook that fires after all menu items have
been added and save their data to the options table.
* Hook another function to that same action hook that checks to see if any
plugins have been activated. If they have, it could get the saved data
from the options table and compare it with the newly generated data for
the current page load to determine which item items are new.
That would be a cleaner way of doing it rather than relying on the global
$menu and $submenu arrays like my plugin does, since some of those menu
items contain HTML and other data. So capturing the original data from
when menu items were originally added using add_menu_page() and
add_submenu_page() would be preferable.
Lastly, this same feature could be expanded to work for themes as well,
where WP would notify users of any newly added menu items after a theme is
activated. Maybe that's beyond the scope of this ticket, though, based on
the title.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40651#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list