I’m writing a plugin which would print a notice, but only on the media page. I found the admin_notices
and all_admin_notices
actions, but these are fired on all admin pages. Is there any way to find which admin page is the hook being called on from within the callback?
2 comments
Comments are closed.
There is a global variable called $pagenow for the use within WP Admin:
UPDATE: Simply include the snippet in your themes or plugins
functions.php
An alternative way is using the
load-{$page}
hook.Example:
See ‘admin_notices’ hook docs on Codex