Created
June 20, 2012 21:45
-
-
Save mojowen/2962427 to your computer and use it in GitHub Desktop.
Add Filter for Microsoft Word Style elements
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
<?php | |
add_filter('the_content', 'remove_microsoft_word'); | |
function remove_microsoft_word($content) { | |
$find = strpos($content,"<style type=\"text/css\"> | |
<!-- | |
/* Font Definitions */"); | |
while( $find ) { | |
$end = strpos($content," | |
--> | |
</style>",$find); | |
$content = substr($content,$end+14); | |
$find = strpos($content,"<style type=\"text/css\"> | |
<!-- | |
/* Font Definitions */"); | |
} | |
return $content; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add to functions.php. Only works well when style elements are at the head of a document.