get_blog_permalink( int $blog_id, int $post_id ): string

Gets the permalink for a post on another blog.

Parameters

$blog_idintrequired
ID of the source blog.
$post_idintrequired
ID of the desired post.

Return

string The post’s permalink.

Source

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

	return $link;
}

Changelog

VersionDescription
MU (3.0.0) 1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.