Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
Adding custom SmugMug domain to oEmbed whitelist in WordPress (full regex version)
// From
// This version is based on the SmugMug code from wp-includes/class-oembed.php
// Even if you set both WWW and non-WWW versions as CNAMEs in your DNS settings, an oEmbed attempt to the wrong custom SmugMug domain (e.g. WWW if the custom domain in your SmugMug settings is non-WWW) will not work, which is why (www\.)? is not in the regex
// for a custom SmugMug subdomain like (notice the "backslash-dot" after the subdomain)
wp_oembed_add_provider( '#https?://?media\.mydomain\.com/.*#i', '', true );
// for a custom SmugMug domain like
//wp_oembed_add_provider( '#https?://?mydomain\.com/.*#i', '', true );
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.