Я хочу, чтобы функция wordpress заменяла iframe src, например: (http://my1stembed.tld/variablestring.html) на (http://my2ndembed.tld/variablestring.html), с содержимым поста в Wordpress на переменную.Как мне это сделать.Мне нужна функция, подобная этой
function replace_content($content) { $content = str_replace('http://my1stembed.tld/', 'http://my2ndembed.tld/',$content); return $content; } add_filter('the_content','replace_content');
Вышеуказанная функция является заменой только фиксированной, например: (http://my1stembed.tld/) строки на (http://my2ndembed.tld/), а не переменной.Я новичок в WordPress и понятия не имею.Любая помощь высоко ценится.
<iframe src="http://my1stembed.tld/embed/variablefilename/" width="640" height="360" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen"></iframe>
до
<iframe src="http://my2ndembed.tld/embed/variablefilename/" width="640" height="360" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen"></iframe>