Look into the global variable $wp_filter. See my plugin for a list of all comment filters for an example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | <?php /* Plugin Name: List Comment Filters Description: List all comment filters on wp_footer Version: 1.1 Author: Fuxia Scholz License: GPL v2 */ add_action( 'wp_footer', 'list_comment_filters' ); function list_comment_filters() { global $wp_filter; $comment_filters = array (); $h1 = '<h1>Current Comment Filters</h1>'; $out = ''; $toc = '<ul>'; foreach ( $wp_filter as $key => $val ) { if ( FALSE !== strpos( $key, 'comment' ) ) { $comment_filters[$key][] = var_export( $val, TRUE ); } } foreach ( $comment_filters as $name => $arr_vals ) { $out .= "<h2 id=$name>$name</h2><pre>" . implode( "\n\n", $arr_vals ) . ' |
’;
$toc .= “
“;
}
print “$h1$toc
$out”;
}
Sample output for pre_comment_author_email:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | array ( 10 => array ( 'trim' => array ( 'function' => 'trim', 'accepted_args' => 1, ), 'sanitize_email' => array ( 'function' => 'sanitize_email', 'accepted_args' => 1, ), 'wp_filter_kses' => array ( 'function' => 'wp_filter_kses', 'accepted_args' => 1, ), ), ) |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.