[wp-hackers] Detect Network Admin in admin_init?

Jeff Rose jeff at jeffrose.ca
Fri Nov 22 22:43:03 UTC 2013


I have a plugin that's doing register_settings on the admin_init hook and
that is apparently running database queries (to populate some options) even
on the Network Admin page where it's not necessary.

Is there any way to detect that we're on a Network page (Network Admin
dashboard etc) during this hook? The $current_screen global doesn't seem to
be set yet and URL hacking seems... hacky.

Any advice is appreciated as always.

-- 
Jeff Rose
------------------
http://www.jeffrose.ca/twitter
http://www.jeffrose.ca/facebook


More information about the wp-hackers mailing list