add oembed provider

The easiest way would be to take advantage of Embedly’s outstanding API. Add this code to your theme’s functions.php: // Add Myvideo oEmbed function add_oembed_myvideo(){ wp_oembed_add_provider( ‘http://www.myvideo.ge/*’, ‘http://api.embed.ly/v1/api/oembed’ ); } add_action(‘init’, ‘add_oembed_myvideo’); Embedly is free up to 5,000 “unique URLs per hour per month”. Unless you’re going wild with embeds on your site, you’ll probably … Read more

Getting results from wp_oembed_add_provider

Ok I managed to solve this! Did some digging through how the embed system works, and it turns out it wasn’t the use of wp_oembed_add_provider() that was wrong. Debugging autoembed_callback() in wp-includes\class-wp-embed.php showed that my YouTube URL was coming through but my Facebook URL never made it to this function. Echo’ing the post content before … Read more

wp_embed_register_handler to embed html files

Fixing the regex pattern To match an url of the type: https://coptic-treasures.com/ {Some string with a mix of a-z letters and hyphen}/{Some number}.html like this example: https://coptic-treasures.com/html-test-filed/02.html you can try this kind of pattern: ‘#https://coptic-treasures.com/([a-z-]+)/([0-9]+)\.html$#i’ and then you have to update the iframe output accordingly: … src=”https://coptic-treasures.com/%1$s/%2$s.html” … with the corresponding matches. Demo Here’s a … Read more

WordPress 5.3.x YouTube oEmbed is not working

So apparently the issue also happens in WordPress 5.6 (the latest release as of writing), and YouTube is probably at fault because the (oEmbed) <link> tags are in the body instead of the head (see screenshot below), and that in turn causes the issue because WP_oEmbed::discover() looks for the <link> tags in the head only. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)