Languages: English • Italiano • 日本語 (Add your language)
Changes double line-breaks in the text into HTML paragraphs (<p>...</p>).
WordPress uses it to filter the content and the excerpt.
<?php wpautop( $foo, $br ); ?>
<?php $some_long_text = 'Some long text that has many lines and paragraphs in it.'; echo wpautop( $some_long_text ); ?>
This should echo the string with <p> tags around the paragraphs, like this:
<p>Some long text<br/> that has many lines</p> <p>and paragraphs in it.</p>
Some people choose to disable the wpautop filter from within their theme's functions.php:
remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'wpautop' );
There's also a plugin available to enable/disable the filter on a post-by-post basis.
Since: 0.71
wpautop() is located in wp-includes/formatting.php
.