You appear to be a bot. Output may be restricted
Description
Return the number of attached hooksIf we know that there are attached hooks then we can probably save some time by removing them. It depends what they do. You can find out more about the attached hooks by using ad hoc trace
Usage
$integer = bw_trace_get_attached_hook_count( $hook );
Parameters
- $hook
- ( string ) required –
Returns
integer the number of attached hook functionsSource
File name: oik-bwtrace/includes/oik-action-counts.phpLines:
1 to 20 of 20
function bw_trace_get_attached_hook_count( $hook ) { $count_hooks = 0; global $wp_filter; $hooks = bw_array_get( $wp_filter, $hook, null ); if ( $hooks ) { $hooks = $hooks->callbacks; } else { $hooks = array(); } if ( is_array( $hooks ) ) { $count_hooks = count( $hooks ); } if ( $count_hooks ) { $count_hooks = 0; foreach ( $hooks as $priority => $functions ) { $count_hooks += count( $functions ); } } return( $count_hooks ); }View on GitHub View on Trac