I have a simple code:
function filter_widgets($content) {
global $post;
if($post->ID = 1210) {
$content = preg_replace('/<p>s*(<iframe .*>*.</iframe>)s*</p>/iU', '', $content);
}
return $content;
}
add_filter('the_content', 'filter_widgets');
But when run postId=1210 is result can’t iframe, how to fix it?
try this