[wp-hackers] How to determine which admin screen I'm currently viewing
elrabino at gmail.com
Tue Nov 29 20:10:48 UTC 2011
Móvil: +54 (0261) 15-315-2244
On Tue, Nov 29, 2011 at 5:00 PM, 24/7 <24-7 at gmx.net> wrote:
> After inspecting core for about a day, I now had to come here to ask this
> Q, because I'm completely at the end with my ideas.
> I'm trying to write a plugin that needs to trigger on every admin UI page.
> Therefore I need to find out, where I exactly am.
> $GLOBALS['current_screen']; gives me some basic data, but when building the
> array I compare against, I have no clue where to get consistent data from.
> I use the globals $menu, $submenu; to build a multidimensional array
> containing the admin menu items as shown in this paste .
> Point is that already tried to compare against global $self,
> $current_screen, $parent_file, $submenu_file, $plugin_page,
> $admin_page_hooks, $_registered_pages, $_parent_pages; but none
> was consistent across all admin pages. I also couldn't get behind the logic
> what exactly is used where.
> I hope someone can give me a bit of an insight into this.
> Thanks a lot!
> Best wishes,
>  Pastebin w exemplary admin menu items http://pastebin.com/hssR1E16
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers