Opened 6 years ago
Closed 6 years ago
#45360 closed feature request (wontfix)
Store and get hook args in WP_Hook
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Plugins | Keywords: | |
Focuses: | Cc: |
Description
Hi
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.
Thanks
Change History (3)
Note: See
TracTickets for help on using
tickets.
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.