A WordPress-centric search engine for devs and theme authors



get_blog_post ›

Since3.0.0) 1.0
Deprecatedn/a
get_blog_post ( $blog_id, $post_id )
Parameters: (2)
  • (int) $blog_id ID of the blog.
    Required: Yes
  • (int) $post_id ID of the post you're looking for.
    Required: Yes
Returns:
  • (WP_Post|null) WP_Post on success or null on failure
Defined at:
Codex:
Change Log:
  • MU

Get a blog post from any site on the network.



Source

function get_blog_post( $blog_id, $post_id ) {
	switch_to_blog( $blog_id );
	$post = get_post( $post_id );
	restore_current_blog();

	return $post;
}