Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#45360 closed feature request (wontfix)

Store and get hook args in WP_Hook

Reported by: hamedmoodi's profile hamedmoodi Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Plugins Keywords:
Focuses: Cc:



I think it is good that developer have access to args hooks in WP_Hook objects in global $wp_filter.

I offer WP_Hook could be have 'public $args' and set args in do_action method.

Final developers has access to args for each hook for programming.


Change History (3)

#1 @lonelyvegan
6 years ago

  • Milestone changed from Awaiting Review to Future Release

#2 @johnbillion
5 years ago

  • Keywords close added
  • Version 5.0 deleted

I'm not sure that this is something that belongs in core, because storing the arguments that are passed to hook callbacks can consume huge amounts of memory, particularly when object instances are being passed around. I've run into this problem in my Query Monitor plugin, which has to work very hard to minimise the amount of data that it stores to avoid consuming too much memory.

If you really need to access all the arguments passed to each hook, you can do it by attaching a callback to the all hook which logs them, but bear in mind it will quickly eat up memory.

#3 @desrosj
5 years ago

  • Keywords close removed
  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I tend to agree with @johnbillion. Going to close this out.

Note: See TracTickets for help on using tickets.