The short answer is “you can’t”. To avoid various compatibility issues, this plugin only modifies $menu
and $submenu
right before WordPress outputs the admin menu, and then it restores the original values afterwards.
If you want to make some changes to a menu item, this plugin does have two filters that you could use: custom_admin_menu
and custom_admin_submenu
. Each of the filters is called multiple times: once per menu item of the appropriate type. custom_admin_menu
is used for top level menus and custom_admin_submenu
is for submenu items.
The filter argument is an array of menu properties in an internal, plugin-specific format.