get_blog_post

Advertisement

Summery Summery

Get a blog post from any site on the network.

Syntax Syntax

get_blog_post( int $blog_id, int $post_id )

Parameters Parameters

$blog_id

(Required) ID of the blog.

$post_id

(Required) ID of the post being looked for.

Return Return

(WP_Post|null) WP_Post on success or null on failure

Source Source

File: wp-includes/ms-functions.php

 * @param int $post_id ID of the post being looked for.
 * @return WP_Post|null WP_Post object on success, null on failure
 */
function get_blog_post( $blog_id, $post_id ) {
	switch_to_blog( $blog_id );
	$post = get_post( $post_id );
	restore_current_blog();

Advertisement

Changelog Changelog

Changelog
Version Description
MU (3.0.0) Introduced.

Advertisement

Leave a Reply