[wp-trac] [WordPress Trac] #21170: JavaScript actions and filters

WordPress Trac noreply at wordpress.org
Tue Sep 26 15:08:31 UTC 2017


#21170: JavaScript actions and filters
-----------------------------+-------------------------
 Reporter:  koopersmith      |       Owner:
     Type:  feature request  |      Status:  assigned
 Priority:  normal           |   Milestone:  4.9
Component:  General          |     Version:  3.4
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:  javascript
-----------------------------+-------------------------

Comment (by mgibbs189):

 > Having a single global wp.hooks now feels like an anti-pattern in the
 age of packages and modules, whereas including an instance of wp.Hooks in
 each component feels very much in-line with standard practice in JS.

 What if one plugin needs to modify or remove hooks defined from another
 plugin? Or remove '''all''' handlers attached to a hook name? How would
 that look w/ the component-based approach?

 @westonruter there's definitely pro's of component-based... but I still
 think the need remains for a  `wp.hooks` global store as the single source
 of truth -- regardless of whether it ''feels'' like an anti-pattern.

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


More information about the wp-trac mailing list