函数原型
get_blog_permalink( int $blog_id, int $post_id ): string
函数描述
Gets 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
函数位置
File: wp-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;
}
源码链接
变更日志
| Version | Description |
|---|---|
| MU (3.0.0) 1.0 | Introduced. |

