Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 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 4 years ago.

Download all attachments as: .zip

Change History (8)

@jakub.tyrcha4 years ago

comment:1 @jakub.tyrcha4 years ago

like this? :)

comment:2 @dd324 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.

comment:3 @jakub.tyrcha4 years ago

Aren't load-* hooks $plugin_page-related ?

Version 0, edited 4 years ago by jakub.tyrcha (next)

comment:4 @dd324 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)

comment:5 @jakub.tyrcha4 years ago

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

comment:6 @jcnetsys4 years ago

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

Thanks guys for clarifying that.

comment:7 @duck_4 years ago

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