Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Created June 20, 2022 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/72f24a40d599fb2216df96200f3adad5 to your computer and use it in GitHub Desktop.
Save KaineLabs/72f24a40d599fb2216df96200f3adad5 to your computer and use it in GitHub Desktop.
Youzify - BuddyPress Disable Self-Domain Embeds
<?php
/**
* Youzify - BuddyPress Mark Local Site Links as not Embed.
*/
add_filter( 'pre_oembed_result', function( $null = null, $url ) {
$site_domain = parse_url( site_url(), PHP_URL_HOST);
if ( strpos( $url, $site_domain ) !== false ) {
return '';
}
return null;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment