Skip to content

Instantly share code, notes, and snippets.

@ngm ngm/functions.php
Created Mar 28, 2019

What would you like to do?
Wordpress embed handler for
wp_embed_register_handler( 'invidious_watch', '#https?://invidio\.us/watch\?v=([A-Za-z0-9\-_]+)#i', 'wp_embed_handler_invidious' );
wp_embed_register_handler( 'invidious_embed', '#https?://invidio\.us/embed/([A-Za-z0-9\-_]+)#i', 'wp_embed_handler_invidious' );
function wp_embed_handler_invidious( $matches, $attr, $url, $rawattr ) {
$embed = sprintf(
'<iframe src="$s" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" width="600" height="400"></iframe>',
return $embed;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.