Skip to content

Instantly share code, notes, and snippets.

@ThierryA
Last active January 4, 2016 06:19
Show Gist options
  • Save ThierryA/8581603 to your computer and use it in GitHub Desktop.
Save ThierryA/8581603 to your computer and use it in GitHub Desktop.
WordPress: count actions.
<?php
// Do not include the opening php tag if it is already included in your file.
function your_prefix_count_actions( $tag ) {
global $wp_filter;
if ( !isset( $wp_filter[$tag] ) )
return 0;
$count = 0;
foreach ( $wp_filter[$tag] as $group )
$count += count( $group );
return $count;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment