Created
November 30, 2011 00:04
-
-
Save jmdodd/1407265 to your computer and use it in GitHub Desktop.
Remove curly quotes on save
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 | |
if ( ! function_exists( 'ucc_remove_curly_quotes' ) ) { | |
function ucc_remove_curly_quotes( $content ) { | |
$content = str_replace( array( '“', '”', '“', '”', '“', '”' ), '"', $content ); | |
$content = str_replace( array( '‘', '’', '‘', '’', '‘', '’' ), "'", $content ); | |
return $content; | |
} } | |
add_filter( 'content_save_pre', 'ucc_remove_curly_quotes' ); | |
add_filter( 'pre_comment_content', 'ucc_remove_curly_quotes' ); | |
/* | |
Copyright 2011 Jennifer M. Dodd (email: jmdodd@gmail.com) | |
Released under the GPLv2 (or later). | |
*/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment