[wordpress] 输出一个过滤器绑定的方法

时间:2022-12-29 17:06:40

参考了WordPress: How do I get all the registered functions for 'the_content' filter,

function print_filters_for( $hook = '' ) {
global $wp_filter;
if( empty( $hook ) || !isset( $wp_filter[$hook] ) )
return; print '<pre>';
print_r( $wp_filter[$hook] );
print '</pre>';
}

调用它时,像

print_filters_for('determine_current_user');

相关文章