Embeds: Disable embeds on deactivated Multisite sites.

Props xknown, whyisjake, zieladam, peterwilsoncc.
Merges [49374] to trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@49383 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2020-10-29 17:59:40 +00:00
parent add6bedf3a
commit 4cbb155815
2 changed files with 35 additions and 0 deletions
+5
View File
@@ -610,6 +610,11 @@ function get_oembed_response_data_for_url( $url, $args ) {
$sites = get_sites( $qv );
$site = reset( $sites );
// Do not allow embeds for deleted/archived/spam sites.
if ( ! empty( $site->deleted ) || ! empty( $site->spam ) || ! empty( $site->archived ) ) {
return false;
}
if ( $site && get_current_blog_id() !== (int) $site->blog_id ) {
switch_to_blog( $site->blog_id );
$switched_blog = true;