callbacks; if ( ! is_array( $hook[ $tag ] ) ) { $hook[ $tag ] = array(); trigger_error( "Nothing found for '$tag' hook", E_USER_WARNING ); return; } } else { $hook = $wp_filter; ksort( $hook ); } $output .= '
';
foreach ( $hook as $tag => $priorities ) {
if ( ! is_array( $priorities ) ) {
continue;
}
$output .= "\n>>>>>\t$tag\n";
ksort( $priorities );
foreach ( $priorities as $priority => $functions ) {
$output .= $priority;
foreach ( $functions as $name => $properties ) {
$output .= "\t$name";
if ( is_array( $properties['function'] ) ) {
if ( is_object( $properties['function'][0] ) ) {
$output .= "\t\t" . get_class( $properties['function'][0] ) . " (Object)\n";
}
} elseif ( is_object( $properties['function'] ) && $properties['function'] instanceof \Closure ) {
/**
* @link http://stackoverflow.com/questions/38241093/how-to-get-array-from-a-closure-object-in-php
*/
$reflection = new \ReflectionFunction( $properties['function'] );
$reflection->getClosureScopeClass();
$output .= "\t\t" . get_class( $reflection->getClosureThis() ) . " (Closure)\n";
} else {
$output .= "\t\t (Function)\n";
}
$output .= "\n";
}
}
}
$output .= '';
if ( ! $echo ) {
return $output;
}
echo $output;
}
}