Ticket #21595: ms-functions.diff
File ms-functions.diff, 734 bytes (added by , 13 years ago) |
---|
-
wp-includes/ms-functions.php
155 155 * @return object The post. 156 156 */ 157 157 function get_blog_post( $blog_id, $post_id ) { 158 global $wpdb;159 160 158 $key = $blog_id . '-' . $post_id; 161 159 $post = wp_cache_get( $key, 'global-posts' ); 162 160 if ( $post == false ) { 163 $post = $wpdb->get_row( $wpdb->prepare( 'SELECT * FROM ' . $wpdb->get_blog_prefix( $blog_id ) . 'posts WHERE ID = %d', $post_id ) ); 161 switch_to_blog( $blog_id ); 162 $post = get_post($post_id); 163 restore_current_blog(); 164 164 wp_cache_add( $key, $post, 'global-posts' ); 165 165 } 166 167 166 return $post; 168 167 } 169 168