Guest User

Untitled

a guest
Nov 21st, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1.         $the_content = $post->post_content;
  2.        
  3.         $the_class = preg_match('~flex-video~', $the_content, $class);
  4.        
  5.         print_r($class['0']);
  6.        
  7.         if($class['0'] == 'flex-video'){
  8.             $div_height = preg_match('~<iframe.*height=("[0-9]*")~', $the_content, $height_replace);
  9.            
  10.             $ppost = preg_replace('~class="flex-video"~', 'class="flex-video" width='.$height_replace['0'].'',  $the_content);
  11.            
  12.             echo $ppost;
  13.         }
Add Comment
Please, Sign In to add comment