[wp-trac] [WordPress Trac] #45360: Store and get hook args in WP_Hook

WordPress Trac noreply at wordpress.org
Thu Feb 14 14:12:52 UTC 2019


#45360: Store and get hook args in WP_Hook
-----------------------------+-----------------------------
 Reporter:  hamedmoodi       |       Owner:  (none)
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Future Release
Component:  Plugins          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  close            |     Focuses:
-----------------------------+-----------------------------
Changes (by johnbillion):

 * keywords:   => close
 * version:  5.0 =>


Comment:

 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45360#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list