Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $the_content = $post->post_content;
- $the_class = preg_match('~flex-video~', $the_content, $class);
- print_r($class['0']);
- if($class['0'] == 'flex-video'){
- $div_height = preg_match('~<iframe.*height=("[0-9]*")~', $the_content, $height_replace);
- $ppost = preg_replace('~class="flex-video"~', 'class="flex-video" width='.$height_replace['0'].'', $the_content);
- echo $ppost;
- }
Add Comment
Please, Sign In to add comment