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

WordPress Trac noreply at wordpress.org
Mon Sep 25 20:54:29 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 adamsilverstein):

 > Or if the reference to `fooFilter` is not available then this can be
 used instead:
 >
 > {{{#!js
 > component.removeAllFilters( 'foo' );
 > }}}

 @westonruter Right, this highlights an issue: if anonymous callbacks are
 added to hooks, we can't individually remove them and instead have to
 remove all the hooked callbacks. By adding the namespace requirement, we
 ensure the individual callbacks can always be removed (discussed somewhere
 above).

 Regardless, this could still work as you are proposed - something
 instantiated on an object, that would simplify the namespacing, since the
 package/plugin part would be the object itself.

 What other advantages do you imagine object extension vs the current
 approach would offer?

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


More information about the wp-trac mailing list