Advertisement
ghenzdeveloper

PeepSo Force allow fullscreen video embed

Feb 16th, 2025 (edited)
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. add_filter('peepso_videos_attach_before', function ($video) {
  2.     // Check if the video content contains the specific URL  
  3.     if (strpos($video['content'], 'https://ratner-vod.com/videos/embed/') !== false) {
  4.         // Remove security="restricted" from the iframe, if present  
  5.         $video['content'] = preg_replace('/<iframe(.*)security="restricted"(.*)>/', '<iframe$1$2>', $video['content']);
  6.  
  7.         // Forcefully add allowfullscreen to the iframe  
  8.         $video['content'] = preg_replace('/<iframe(.*?)>/i', '<iframe$1 allowfullscreen>', $video['content']);
  9.     }
  10.     return $video;
  11. }, 10, 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement