-
-
Save laurent-d/b00dfc7cf7132f0a423c437934a13508 to your computer and use it in GitHub Desktop.
Removed the paragraph tag that wordpress' wpautop puts around images - Php 5.6 > *
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wpautop_fix( $content ){ | |
$content = preg_replace('/<p[^>]*>(<img[^>]*>)<\\/p[^>]*>/i', '$1', $content); | |
return $content; | |
} | |
add_filter('the_content', 'wpautop_fix'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment