#18061 closed feature request (wontfix)
No admin_init-{$page_hook} action - why?
Reported by: | jcnetsys | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 3.2 |
Component: | Plugins | Keywords: | |
Focuses: | Cc: |
Description
Hi all,
Currently I have a function that is fired at admin_init on every admin page call. It then checks to see whether the page GET variable matches the one for my plugin and if it doesn't then returns. I don't understand why there isn't an admin_init-{$page_hook} action like there is for admin_head. It would make attaching page specific actions much easier.
Look forward to your response,
Daniel Chatfield
Attachments (1)
Change History (8)
#2
@
13 years ago
We already have the load-$pagenow
and load-$pluginpage
hooks, I don't see any advantage to adding a admin_init-$pagenow
variant which in most cases, would be exactly the same.
#3
@
13 years ago
Aren't load-* hooks $plugin_page-related ?
That's probably enough for the ticket author, but I'm just wondering if there are any circumstances where admin_init-* could be useful
#4
@
13 years ago
Aren't load-* hooks $plugin_page-related ?
They're run for plugins and core pages alike, it should be called directly below that added call in 2 of hte 3 blocks (Importers don't seem to get it)
like this? :)