Gets a blog post from any site on the network.
This function is similar to get_post() , except that it can retrieve a post from any site on the network, not just the current site.
$blog_idintrequired
$post_idintrequired
function get_blog_post( $blog_id, $post_id ) {
switch_to_blog( $blog_id );
$post = get_post( $post_id );
restore_current_blog();
return $post;
}
| Version | Description |
|---|---|
| MU (3.0.0) | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_blog_post