@wordpress/hooks
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -47,9 +47,2 @@ /** | ||
if (!hooks[hookName]) { | ||
hooks[hookName] = { | ||
runs: 0, | ||
handlers: [] | ||
}; | ||
} | ||
while (hookInfo.currentIndex < handlers.length) { | ||
@@ -56,0 +49,0 @@ var handler = handlers[hookInfo.currentIndex]; |
@@ -54,9 +54,2 @@ "use strict"; | ||
if (!hooks[hookName]) { | ||
hooks[hookName] = { | ||
runs: 0, | ||
handlers: [] | ||
}; | ||
} | ||
while (hookInfo.currentIndex < handlers.length) { | ||
@@ -63,0 +56,0 @@ var handler = handlers[hookInfo.currentIndex]; |
{ | ||
"name": "@wordpress/hooks", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "WordPress hooks library.", | ||
@@ -31,3 +31,3 @@ "author": "The WordPress Contributors", | ||
}, | ||
"gitHead": "0aa5c4340f57a69ab935f9e819d74958aad2e022" | ||
"gitHead": "308f6aa950705531ef9d360dc88bb9f4194542f5" | ||
} |
@@ -25,3 +25,3 @@ # Hooks | ||
In the WordPress context, API functions can be called via the global `wp.hooks` like this `wp.hooks.addAction()`, etc. | ||
In the WordPress context, API functions can be called via the global `wp.hooks` like this `wp.hooks.addAction()`, etc. One notable difference from the PHP API is that `addAction()` and `addFilter()` also need to include a namespace as the second argument. | ||
@@ -31,6 +31,6 @@ ### API Usage | ||
* `createHooks()` | ||
* `addAction( 'hookName', 'functionName', callback, priority )` | ||
* `addFilter( 'hookName', 'functionName', callback, priority )` | ||
* `removeAction( 'hookName', 'functionName' )` | ||
* `removeFilter( 'hookName', 'functionName' )` | ||
* `addAction( 'hookName', 'namespace', 'functionName', callback, priority )` | ||
* `addFilter( 'hookName', 'namespace', 'functionName', callback, priority )` | ||
* `removeAction( 'hookName', 'namespace', 'functionName' )` | ||
* `removeFilter( 'hookName', 'namespace', 'functionName' )` | ||
* `removeAllActions( 'hookName' )` | ||
@@ -37,0 +37,0 @@ * `removeAllFilters( 'hookName' )` |
@@ -46,9 +46,2 @@ /** | ||
if ( ! hooks[ hookName ] ) { | ||
hooks[ hookName ] = { | ||
runs: 0, | ||
handlers: [], | ||
}; | ||
} | ||
while ( hookInfo.currentIndex < handlers.length ) { | ||
@@ -55,0 +48,0 @@ const handler = handlers[ hookInfo.currentIndex ]; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143410
1911