2

There is a function called apply_filter where you can use it like this:

echo apply_filter('the_content', $my_content);

It add formatting tags and clean up the content.

Trac or docs

I looked in the trac and docs but could not find what functions are used in the apply_filter function.

I found wpautop

The only one I found was wpautop:

http://codex.wordpress.org/Function_Reference/wpautop

What more? Hint me to the trac or some docs with a list of functions that are used.

  • 1
    You could make a function to print the filters for a given hook, see my answer from SO for a function to help. – t31os May 10 '13 at 9:10
4

You can use the global $wp_filter array to check for callbacks on each filter. Here is for example a code snippet that prints out all the callbacks on the the_content filter in the footer part of your theme:

add_action('wp_footer',function(){
        global $wp_filter;
        printf('<pre>%s</pre>',print_r( $wp_filter['the_content'],true));
});

The priority 10 part could look like this:

   [10] => Array
        (
            [wptexturize] => Array
                (
                    [function] => wptexturize
                    [accepted_args] => 1
                )

            [convert_smilies] => Array
                (
                    [function] => convert_smilies
                    [accepted_args] => 1
                )

            [convert_chars] => Array
                (
                    [function] => convert_chars
                    [accepted_args] => 1
                )

            [wpautop] => Array
                (
                    [function] => wpautop
                    [accepted_args] => 1
                )

            [shortcode_unautop] => Array
                (
                    [function] => shortcode_unautop
                    [accepted_args] => 1
                )

            [prepend_attachment] => Array
                (
                    [function] => prepend_attachment
                    [accepted_args] => 1
                )

        )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.