从网络上的任何站点获取博客文章。
原型
get_blog_post( int $blog_id, int $post_id )
参数
$blog_id
(int)
(Required)
博客的ID。
$post_id
(int)
(Required)
你正在寻找的帖子的ID。
返回值
(WP_Post|null)
源文件
路径:wp-includes/ms-functions.php
<?php
...
function get_blog_post( $blog_id, $post_id ) {
switch_to_blog( $blog_id );
$post = get_post( $post_id );
restore_current_blog();
return $post;
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/get_blog_post/