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

WordPress Trac noreply at wordpress.org
Tue Sep 12 12:53:23 UTC 2017


#21170: JavaScript actions and filters
---------------------------------------------+-----------------------------
 Reporter:  koopersmith                      |       Owner:
     Type:  feature request                  |  adamsilverstein
 Priority:  normal                           |      Status:  closed
Component:  General                          |   Milestone:  4.9
 Severity:  normal                           |     Version:  3.4
 Keywords:  has-patch has-unit-tests commit  |  Resolution:  fixed
                                             |     Focuses:  javascript
---------------------------------------------+-----------------------------
Changes (by adamsilverstein):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"41375"]:
 {{{
 #!CommitTicketReference repository="" revision="41375"
 Add `wp.hooks` - JavaScript actions and filters.

 Add a JavaScript hooks library with an API that mirrors the WordPress
 Plugin API; provides similar functionality and API to PHP hooks.

 Called via the global `wp.hooks`, eg: `wp.hooks.addAction()`, etc. Adds:

 * `addAction( 'hook', 'vendor/plugin/function', callback, priority )`
 * `addFilter( 'hook', 'vendor/plugin/function', callback, priority )`
 * `removeAction( 'hook', 'vendor/plugin/function' )`
 * `removeFilter( 'hook',  'vendor/plugin/function' )`
 * `removeAllActions( 'hook' )`
 * `removeAllFilters( 'hook' )`
 * `doAction( 'hook', arg1, arg2, moreArgs, finalArg )`
 * `applyFilters( 'hook', content, arg1, arg2, moreArgs, finalArg )`
 * `doingAction( 'hook' )`
 * `doingFilter( 'hook' )`
 * `didAction( 'hook' )`
 * `didFilter( 'hook' )`
 * `hasAction( 'hook' )`
 * `hasFilter( 'hook' )`

 Props adamsilverstein, jnylen0, aduth, kadamwhite, youknowriad,
 schlessera, mikeschinkel, azaozz, vhauri, CaptainN, scribu, carldanley,
 chetanchauhan, mgibbs189, stephenharris, justnorris, koopersmith, gcorne,
 TV productions, atimmer.

 Fixes #21170.
 }}}

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


More information about the wp-trac mailing list