Definition:
function get_blog_post( $blog_id, $post_id ) {}
Get a blog post from any site on the network.
Parameters
- int $blog_id: ID of the blog.
- int $post_id: ID of the post you’re looking for.
Return values
returns:post.
Source code
function get_blog_post( $blog_id, $post_id ) { global $wpdb; $key = $blog_id . '-' . $post_id; $post = wp_cache_get( $key, 'global-posts' ); if ( $post == false ) { $post = $wpdb->get_row( $wpdb->prepare( 'SELECT * FROM ' . $wpdb->get_blog_prefix( $blog_id ) . 'posts WHERE ID = %d', $post_id ) ); wp_cache_add( $key, $post, 'global-posts' ); } return $post; }
1218
No comments yet... Be the first to leave a reply!