get_blog_permalink()WP 3.0.0

Gets the permalink for a post on another blog.

Хуков нет.

Возвращает

Строку. The post's permalink.

Использование

get_blog_permalink( $blog_id, $post_id );
$blog_id(int) (обязательный)
ID of the source blog.
$post_id(int) (обязательный)
ID of the desired post.

Список изменений

С версии 3.0.0 Введена.
Since MU (3.0.0) 1.0

Код get_blog_permalink() WP 6.4.3

function get_blog_permalink( $blog_id, $post_id ) {
	switch_to_blog( $blog_id );
	$link = get_permalink( $post_id );
	restore_current_blog();

	return $link;
}