Last active
February 10, 2016 13:37
-
-
Save Perun/2ba6fdce4de6d942df19 to your computer and use it in GitHub Desktop.
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
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 | |
// 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 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment