Created
April 21, 2018 09:26
-
-
Save janzikmund/9dff30abbf7d58f630a81579f9ca0c0f to your computer and use it in GitHub Desktop.
Fixes Ubuntu font not showing quotes properly
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 | |
// replace content filtered entities back, as certain characters are not defined in Ubuntu font | |
add_filter('the_content', 'sw_replace_quotes_back', 100); | |
add_filter('wpp_post', 'sw_replace_quotes_back', 100); | |
add_filter('acf/load_value', 'sw_replace_quotes_back', 100); | |
add_filter('acf/format_value_for_api', 'sw_replace_quotes_back', 100); | |
add_filter('the_title', 'sw_replace_quotes_back', 100); | |
function sw_replace_quotes_back($str) { | |
$search = array('’', '’', '“', '”', '“', '”'); | |
$replace = array("'", "'", '"', '"', '"', '"'); | |
$str = str_replace($search, $replace, $str); | |
return $str; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment