#18061 closed feature request (wontfix)
No admin_init-{$page_hook} action - why?
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Plugins | Version: | 3.2 |
| Severity: | minor | Keywords: | |
| 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)
jakub.tyrcha — 23 months ago
comment:1
jakub.tyrcha — 23 months 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.
comment:3
jakub.tyrcha — 23 months 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
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)
comment:5
jakub.tyrcha — 23 months ago
Ah, I didn't notice the last code block, thanks.
- Resolution set to wontfix
- Status changed from new to closed
Thanks guys for clarifying that.

like this? :)