Created
December 14, 2017 13:51
-
-
Save willybahuaud/4c6772031d056d0202f3a8915aa5b45a to your computer and use it in GitHub Desktop.
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 | |
add_filter( 'the_title', 'willy_insert_missing_unsecable' ); | |
add_filter( 'the_content', 'willy_insert_missing_unsecable' ); | |
function willy_insert_missing_unsecable( $text ) { | |
$patterns = array( | |
'« ' => '« ', | |
' »' => ' »', | |
' :' => ' :', | |
' !' => ' !', | |
' ?' => ' ?', | |
' ;' => ' ;', | |
); | |
return str_replace( array_keys( $patterns ), array_values( $patterns ), $text ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment