Skip to content

Instantly share code, notes, and snippets.

@jimboobrien
Last active June 22, 2020 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimboobrien/597fed60d1199d1884d198716973d9fb to your computer and use it in GitHub Desktop.
Save jimboobrien/597fed60d1199d1884d198716973d9fb to your computer and use it in GitHub Desktop.
<?php
/* put this in functions.php */
function list_hooked_functions( $tag=false ){
global $wp_filter;
if ( $tag ) {
$hook[ $tag ] = $wp_filter[ $tag ];
if ( !is_array( $hook[$tag] ) ) {
trigger_error( "Nothing found for '$tag' hook", E_USER_WARNING );
return;
}
}else{
$hook = $wp_filter;
ksort( $hook );
}
echo '<pre>';
foreach( $hook as $tag => $priority ){
echo "<br />&gt;&gt;&gt;&gt;&gt;\t<strong>$tag</strong><br />";
ksort( $priority );
foreach( $priority as $priority => $function ){
echo $priority;
foreach( $function as $name => $properties ) {
echo "\t$name<br />"
};
}
}
echo '</pre>';
return;
}
/* THEN USE THIS ON A PAGE */
list_hooked_functions();
/* WHAT THE OUTPUT SHOULD LOOK LIKE ON THE PAGE */
>>>>> the_content
8 000000001d3591230000000096d6f3b0run_shortcode
000000001d3591230000000096d6f3b0autoembed
10 wptexturize
convert_smilies
convert_chars
wpautop
shortcode_unautop
prepend_attachment
11 capital_P_dangit
do_shortcode
>>>>> the_content_rss
8 ent2ncr
>>>>> the_excerpt
10 wptexturize
convert_smilies
convert_chars
wpautop
shortcode_unautop
>>>>> the_excerpt_rss
8 ent2ncr
10 convert_chars
>>>>> the_posts
10 _close_comments_for_old_posts
>>>>> the_title
10 wptexturize
convert_chars
trim
11 capital_P_dangit
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment