Filter oembeds tags to modify iframe attributes

I was able to solve the the CORS issue by using this snippet which now allows this iFrame to allow-same-origin or runs scripts inside this domain. function oembed_iframe_overrides($html, $url, $attr) { if ( strpos( $html, “<iframe” ) !== false ) { return str_replace(‘<iframe class=”wp-embedded-content” sandbox=”allow-scripts allow-same-origin”‘, ‘<iframe class=”wp-embedded-content” sandbox’, $html); } else { return $html; … Read more

oEmbed youtube video aspect ratio

WordPress does a pretty good job of embedding videos at the correct aspect ratio. The width of the embedded video is based on the content width set in your theme’s functions.php file. Because of this it sounds as if there may be some styles applied to the iframe element in your theme changing it’s size. … Read more

wp_embed_register_handler is not working

You are trying to match the r2jeim68kuq6.html part, but you’re not allowing dots in your regex pattern here: ‘#https://vidoza\.net/([a-zA-Z0-9_-]+)$#i’ You can try e.g. (removing the A-Z too because of the case-insensitive i search): ‘#https://vidoza\.net/([a-z0-9_-]+)\.html$#i’ if .html is a standard extension and where you also adjust the iframe source to: src=”https://vidoza.net/embed-%1$s.html” Hope it helps!

How to remove the embed_footer?

The comments button and the share button are generated in two separate default actions, so you have to remove them both: remove_action( ’embed_content_meta’, ‘print_embed_comments_button’ ); remove_action( ’embed_content_meta’, ‘print_embed_sharing_button’ );

Add parameters vimeo videos using wordpress embeds

There are several filters in WordPress for altering oEmbed data, depending on when you need to modify the results: embed_handler_html Filters the returned embed handler. embed_oembed_html Filters the cached oEmbed HTML. oembed_result Filters the HTML returned by the oEmbed provider. Choose the one that best suits your needs, but keep in mind that each filter … Read more

Forcing oembeds to top of post

you can create custom post meta which contain youtube url and then $yt=get_post_meta($post->ID,’youtube_url’,true); if( ” != $yt) echo $GLOBALS[‘wp_embed’]->autoembed( $yt ); Updated: If i’m getting correctly then your content contain youtube url any where in it and you want to show them at top regardless there position in content. jut paste this code in functions.php … Read more