Since WordPress 4.7.0 filters and hooks are now stored in the global $wp_filter as instances of class WP_hook. The logic used to determine how many functions are attached to a particular hook is no longer working. In the [hook] shortcode generated at trace shutdown we just get 0's.
Since WordPress 4.7.0 filters and hooks are now stored in the global
$wp_filter
as instances of classWP_hook
. The logic used to determine how many functions are attached to a particular hook is no longer working. In the [hook] shortcode generated at trace shutdown we just get 0's.Expected output
Actual output
Proposed solution
We now need to count the items in the
$hook->callbacks
property. The code need not be backward compatible with earlier versions of WordPress.Further information
The same value for the number of attached functions should be shown when the hook is displayed in context e.g.
The meanings of the three numeric values in the
[hook]
shortcode are:The
[hook]
shortcode is provided by https://github.com/bobbingwide/oik-shortcodes and was used in the https://github.com/bobbingwide/oik-requests prototype plugin.