Created
June 20, 2022 23:27
-
-
Save KaineLabs/72f24a40d599fb2216df96200f3adad5 to your computer and use it in GitHub Desktop.
Youzify - BuddyPress Disable Self-Domain Embeds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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