Skip to content

Instantly share code, notes, and snippets.

@dtbaker
Created October 27, 2014 06:08
Show Gist options
  • Select an option

  • Save dtbaker/b532e0e84a8cb7f22f26 to your computer and use it in GitHub Desktop.

Select an option

Save dtbaker/b532e0e84a8cb7f22f26 to your computer and use it in GitHub Desktop.
Hack for WordPress RTL bracket fix
function dtbaker_rtl_bracket_hack($content){
if(is_rtl()){
$content = preg_replace('#<p>([^<]+)\)\s*</p>#','<p>$1)&#x200E;</p>',$content);
$content = preg_replace('#<p>\s*\(([^<]+)</p>#','<p>&#x200E;($1</p>',$content);
}
return $content;
}
add_filter('the_content','dtbaker_rtl_bracket_hack',100,1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment