bcworkz on "Preg_replace can it ignore shortcodes?"

ساخت وبلاگ

I am using this preg_replace code to change all imgur links on my site:

add_filter('wp_insert_post_data', 'pm_add_memegen');
function pm_add_memegen( $data ) { $data['post_content'] = preg_replace('/imgur.com/(?!memegen/create)/', 'imgur.com/memegen/create/', $data['post_content']); retu $data;
}

But this also affects a Shortcode I have to use to display Imgur ablums which I do not want, because the shortcode will break.

[wpws url="http://imgur.com/a/zaNdd/all" query=".posts"]

Is there a way I can force the preg_replace code to ignore the shortcode and only affect the images displayed on my site?

Thanks

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 163 تاريخ : سه شنبه 4 خرداد 1395 ساعت: 8:00