Why won’t my preg_replace work with content_save_pre?
I copied your code to a file in my home directory on my Ubuntu box, removed the weird character that @s_ha_dum noticed, and ran it. It worked as I’d expect. Code: <?php function get_the_post_imgs($oldPostContent) { $newPostContent = $oldPostContent; $newPostContent = preg_replace_callback( “/<img.*src=[\”‘]([^\”‘]*)[\”‘].*>/i”, // pattern to match to (i.e the contents of an <img src=”https://wordpress.stackexchange.com/questions/140017/…” /> … Read more