Ticket #40673: 40673.2.patch
File 40673.2.patch, 906 bytes (added by , 7 years ago) |
---|
-
wp-includes/embed.php
1071 1071 * Null if the URL does not belong to the current site. 1072 1072 */ 1073 1073 function wp_filter_pre_oembed_result( $result, $url, $args ) { 1074 $switched_blog = false; 1075 1074 1076 if ( is_multisite() ) { 1075 1077 $url_parts = wp_parse_args( wp_parse_url( $url ), array( 1076 1078 'host' => '', … … 1094 1096 1095 1097 if ( $site && (int) $site->blog_id !== get_current_blog_id() ) { 1096 1098 switch_to_blog( $site->blog_id ); 1099 $switched_blog = true; 1097 1100 } 1098 1101 } 1099 1102 … … 1111 1114 $data = get_oembed_response_data( $post_id, $width ); 1112 1115 $data = _wp_oembed_get_object()->data2html( (object) $data, $url ); 1113 1116 1114 if ( is_multisite() && ms_is_switched()) {1117 if ( $switched_blog ) { 1115 1118 restore_current_blog(); 1116 1119 } 1117 1120