I recently upgraded my site from PHP 5 to PHP 7 and loved the speed boost, but then I noticed one of my favorite plugins broke. I was getting this warning:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /Applications/AMPPS/www/mysitetest/wp-content/plugins/wp-code-highlight/wp-code-highlight.php on line 68
Yes, WP Code Highlight has been deprecated for a while, but since I post so much about code snippets, it’s all over my site!
Luckily, I found this post by hoelli which worked perfectly for me. You’ll need to change the code in this file:
wp-content/plugins/wp-code-highlight/wp-code-highlight.php
Look for lines 67-68.
Replace the code there with this code:
So, basically comment out the two lines that were there already, and add the new code. Hope this helps!
Leave a Reply