Shortcodes do not work when preg_replace content
-
Hi,
I am using some preg_replace I did write some time ago:$text = preg_replace('/(\s)(\w)(\s)/', ' $2 ', get_the_content()); echo $text;
It changes every one letter words like ” a ” to ” a “, so non-breaking space force it not to stay on the end of line.
But when I use preg_replace, shortcodes do not work, so [my_sc] appers as [my_sc], and not custom, shortocode code.
How can I preg_replace all content without using my code in single.php, without preventing shortcodes work?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Shortcodes do not work when preg_replace content’ is closed to new replies.