Embeds: In switched state, restore previous state if no post ID is found.

Fixes #40673.

git-svn-id: https://develop.svn.wordpress.org/trunk@41634 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90)
2017-09-28 16:28:46 +00:00
parent bbf0683deb
commit c8ff7f6592
2 changed files with 28 additions and 0 deletions

View File

@@ -1106,6 +1106,10 @@ function wp_filter_pre_oembed_result( $result, $url, $args ) {
$post_id = apply_filters( 'oembed_request_post_id', $post_id, $url );
if ( ! $post_id ) {
if ( $switched_blog ) {
restore_current_blog();
}
return $result;
}