WordPress Blocks – Don’t split hyphenated words
-
Hi,
I am using the WordPress block editor and core blocks to build the website. Is there a way to replace all of the hyphens with non-breaking hyphens?
I’ve tried using this filter hook ‘the_content’, but it doesn’t work and it breaks the site.
This is the code that I’ve used:function replace_content($content){ $content = str_replace('-', "‑",$content); return $content; } add_filter('the_content','replace_content');
Is there a way or any other hooks to do this when using the wordpress core blocks?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘WordPress Blocks – Don’t split hyphenated words’ is closed to new replies.