Skip to content

Instantly share code, notes, and snippets.

@dimadin
Created May 11, 2015 16:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dimadin/f7fcb10ef53a0c180f5c to your computer and use it in GitHub Desktop.
Save dimadin/f7fcb10ef53a0c180f5c to your computer and use it in GitHub Desktop.
Filtering WordPress curly quotes
<?php
function md_filter_curly_double_quotes( $translations, $text, $context, $domain ) {
if ( 'opening curly double quote' == $context && '&#8220;' == $text ) {
$translations = '&#0171;';
} else if ( 'closing curly double quote' == $context && '&#8221;' == $text ) {
$translations = '&#0187;';
}
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