Skip to content

Instantly share code, notes, and snippets.

@Zodiac1978
Forked from dimadin/curly-quotes.php
Last active February 10, 2016 13:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Zodiac1978/1e33b0f58db8333f5f0b to your computer and use it in GitHub Desktop.
Save Zodiac1978/1e33b0f58db8333f5f0b to your computer and use it in GitHub Desktop.
<?php
function md_filter_curly_double_quotes( $translations, $text, $context, $domain ) {
if ( 'opening curly double quote' == $context && '&#8220;' == $text ) {
$translations = '&#8222;';
} else if ( 'closing curly double quote' == $context && '&#8221;' == $text ) {
$translations = '&#8220;';
}
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