WordPress: How do I get all the registered functions for 'the_content' filter

后端 未结 3 924
悲&欢浪女
悲&欢浪女 2020-12-22 23:46

I have a question regarding WordPress, specifically version 3.0 and newer.

Does anyone know how to get an array or list of all the functions that will be applied or

3条回答
  •  情深已故
    2020-12-23 00:09

    Simple function to print from the filter array?

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

    Call it where you need it.

    print_filters_for( 'the_content' );
    

提交回复
热议问题