Created
November 9, 2012 23:42
-
-
Save codehooligans/4049064 to your computer and use it in GitHub Desktop.
Show WordPress filters
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
/* Simple function to show existing WordPress filters */ | |
function show_filter($filter_key='') { | |
if (empty($filter_key)) return false; | |
global $wp_filter; | |
if (isset($wp_filter[$filter_key])) { | |
foreach($wp_filter[$filter_key] as $priority => $filter_sets) { | |
echo "=== Priority [{$priority}] ===<br />"; | |
foreach($filter_sets as $filter_set_key => $filter_set_data) { | |
echo $filter_set_key."<br />"; | |
} | |
echo "<br />"; | |
} | |
} | |
} | |
/* Example show the filters for 'the_content' */ | |
show_filter('the_content'); | |
/* Will output something like - | |
=== Priority [8] === | |
407d309a6597f09e856501cefc99ae6arun_shortcode | |
407d309a6597f09e856501cefc99ae6aautoembed | |
=== Priority [10] === | |
wptexturize | |
convert_smilies | |
convert_chars | |
wpautop | |
shortcode_unautop | |
prepend_attachment | |
=== Priority [11] === | |
capital_P_dangit | |
do_shortcode | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment