Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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:


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)

18061.patch (352 bytes) - added by jakub.tyrcha 10 years ago.

Download all attachments as: .zip

Change History (8)

10 years ago

#1 @jakub.tyrcha
10 years ago

like this? :)

#2 @dd32
10 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 @jakub.tyrcha
10 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

Last edited 10 years ago by jakub.tyrcha (previous) (diff)

#4 @dd32
10 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)

#5 @jakub.tyrcha
10 years ago

Ah, I didn't notice the last code block, thanks.

#6 @jcnetsys
10 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Thanks guys for clarifying that.

#7 @duck_
10 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.