Last active
January 4, 2016 06:19
-
-
Save ThierryA/8581603 to your computer and use it in GitHub Desktop.
WordPress: count actions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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