Die einfachen und die doppelten Anführungszeichen durch die einfachen bzw. doppelten "Anführungszeichen" ersetzen. Ist zwar typographisch nicht wirklich richtig, aber erleichtert die Eingabe von Code-Beispielen und verhindert auch ein paar kleinere Bugs. Ursprünglichen Code hier gefunden: https://gist.github.com/Zodiac1978/1e33b0f58db8333f5f0b
<?php
// Anführungszeichen
function gerade_anfuehrungszeichen( $translations, $text, $context, $domain ) {
if ( 'opening curly single quote' == $context && '‘' == $text ) {$translations = ''';}
if ( 'closing curly single quote' == $context && '’' == $text ) {$translations = ''';}
if ( 'opening curly double quote' == $context && '“' == $text ) {$translations = '"';}
if ( 'closing curly double quote' == $context && '”' == $text ) {$translations = '"';}
return $translations;
}
add_filter( 'gettext_with_context', 'gerade_anfuehrungszeichen', 10, 4 );
?>