Advertisement
GochiSiyan

ads before embed

Mar 29th, 2021
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. add_filter( 'embed_oembed_html', 'jnews_custom_oembed_filter', 99, 4 );
  2.  
  3. function jnews_custom_oembed_filter_custom( $html, $url, $attr, $post_ID ){
  4. $geturl = parse_url($url);
  5.  
  6. if (strstr($geturl['host'], 'youtube.com') || strstr($geturl['host'], 'youtu.be') || strstr($geturl['host'], 'vimeo.com')) {
  7. return '<div class="custom-vid-container">' . $html . '</div>';
  8. }
  9.  
  10. if (strstr($geturl['host'], 'vine.co')) {
  11. return '<div class="custom-vid-container">' . $html . '</div>';
  12. }
  13.  
  14. return $html;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement