Changeset 41600 for trunk/src/wp-includes/embed.php
- Timestamp:
- 09/26/2017 08:39:57 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/embed.php
r41448 r41600 1072 1072 */ 1073 1073 function wp_filter_pre_oembed_result( $result, $url, $args ) { 1074 if ( is_multisite() ) { 1075 $url_parts = wp_parse_args( wp_parse_url( $url ), array( 1076 'host' => '', 1077 'path' => '/', 1078 ) ); 1079 1080 $qv = array( 'domain' => $url_parts['host'], 'path' => '/' ); 1081 1082 // In case of subdirectory configs, set the path. 1083 if ( ! is_subdomain_install() ) { 1084 $path = explode( '/', ltrim( $url_parts['path'], '/' ) ); 1085 $path = reset( $path ); 1086 1087 if ( $path ) { 1088 $qv['path'] = get_network()->path . $path . '/'; 1089 } 1090 } 1091 1092 $sites = get_sites( $qv ); 1093 $site = reset( $sites ); 1094 1095 if ( $site && (int) $site->blog_id !== get_current_blog_id() ) { 1096 switch_to_blog( $site->blog_id ); 1097 } 1098 } 1099 1074 1100 $post_id = url_to_postid( $url ); 1075 1101 … … 1086 1112 $data = _wp_oembed_get_object()->data2html( (object) $data, $url ); 1087 1113 1114 if ( is_multisite() && ms_is_switched() ) { 1115 restore_current_blog(); 1116 } 1117 1088 1118 if ( ! $data ) { 1089 1119 return $result;
Note: See TracChangeset
for help on using the changeset viewer.