I have a string that contains content previously formatted by WP and it contains few types of [caption]
tags. Examples:
[caption (attributes here)]some text[/caption]
[caption (attributes here)]©name and surname[/caption]
[caption id="attachment_49532" align="aligncenter" width="530"][/caption]
I need to remove only the ones that contain ©
followed by the name of the person.
I tried:
preg_replace("/\[caption(.*?)\]©(.*?)\[\/caption\]/","",$string);
but it does the job only if as input string I have only one [caption] tag like
$string = "[caption (parameters here)]©name and surname[/caption]";
and not the string with more elements inside.
What am I doing wrong?