Created
March 4, 2019 16:52
-
-
Save mehh/2dcb8cf57557b4a75f0945fe55bd015f to your computer and use it in GitHub Desktop.
Remove Inline Styles from WordPress the_content();
This file contains hidden or 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
add_filter('the_content', function( $content ){ | |
//--Remove all inline styles-- | |
$content = preg_replace('/ style=("|\')(.*?)("|\')/','',$content); | |
return $content; | |
}, 20); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment