Embeds: Disable embeds on deactivated Multisite sites.

Props xknown, whyisjake, zieladam, peterwilsoncc.
Merges [49374] to trunk.
Built from https://develop.svn.wordpress.org/trunk@49383


git-svn-id: http://core.svn.wordpress.org/trunk@49142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2020-10-29 18:02:05 +00:00
parent cad4a1a3d7
commit 025f5a62a2
2 changed files with 6 additions and 1 deletions

View File

@ -611,6 +611,11 @@ function get_oembed_response_data_for_url( $url, $args ) {
$sites = get_sites( $qv ); $sites = get_sites( $qv );
$site = reset( $sites ); $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 ) { if ( $site && get_current_blog_id() !== (int) $site->blog_id ) {
switch_to_blog( $site->blog_id ); switch_to_blog( $site->blog_id );
$switched_blog = true; $switched_blog = true;

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.6-beta2-49382'; $wp_version = '5.6-beta2-49383';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.