Created
May 11, 2015 16:01
-
-
Save dimadin/f7fcb10ef53a0c180f5c to your computer and use it in GitHub Desktop.
Filtering WordPress curly quotes
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
<?php | |
function md_filter_curly_double_quotes( $translations, $text, $context, $domain ) { | |
if ( 'opening curly double quote' == $context && '“' == $text ) { | |
$translations = '«'; | |
} else if ( 'closing curly double quote' == $context && '”' == $text ) { | |
$translations = '»'; | |
} | |
return $translations; | |
} | |
add_filter( 'gettext_with_context', 'md_filter_curly_double_quotes', 888, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment