get_blog_permalink()
最后更新于:2021-11-26 06:24:20
get_blog_permalink( int$blog_id, int$post_id)Get the permalink for a post on another blog.
参数
- $blog_id
-
(int) (Required) ID of the source blog.
- $post_id
-
(int) (Required) ID of the desired post.
响应
(string) The post’s permalink
源文件
文件: gc-includes/ms-functions.php
function get_blog_permalink( $blog_id, $post_id ) {
switch_to_blog( $blog_id );
$link = get_permalink( $post_id );
restore_current_blog();
return $link;
}