get_blog_permalink

The timeline below displays how wordpress function get_blog_permalink has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Gets the permalink for a post on another blog.
 *
 * @since MU (3.0.0) 1.0
 *
 * @param int $blog_id ID of the source blog.
 * @param int $post_id ID of the desired post.
 * @return string The post's permalink.
 */
function get_blog_permalink($blog_id, $post_id)
{
    switch_to_blog($blog_id);
    $link = get_permalink($post_id);
    restore_current_blog();
    return $link;
}

WordPress Version: 6.1

/**
 * Gets the permalink for a post on another blog.
 *
 * @since MU (3.0.0) 1.0
 *
 * @param int $blog_id ID of the source blog.
 * @param int $post_id ID of the desired post.
 * @return string The post's permalink
 */
function get_blog_permalink($blog_id, $post_id)
{
    switch_to_blog($blog_id);
    $link = get_permalink($post_id);
    restore_current_blog();
    return $link;
}

WordPress Version: 4.9

/**
 * Get the permalink for a post on another blog.
 *
 * @since MU (3.0.0) 1.0
 *
 * @param int $blog_id ID of the source blog.
 * @param int $post_id ID of the desired post.
 * @return string The post's permalink
 */
function get_blog_permalink($blog_id, $post_id)
{
    switch_to_blog($blog_id);
    $link = get_permalink($post_id);
    restore_current_blog();
    return $link;
}

WordPress Version: 3.7

/**
 * Get the permalink for a post on another blog.
 *
 * @since MU 1.0
 *
 * @param int $blog_id ID of the source blog.
 * @param int $post_id ID of the desired post.
 * @return string The post's permalink
 */
function get_blog_permalink($blog_id, $post_id)
{
    switch_to_blog($blog_id);
    $link = get_permalink($post_id);
    restore_current_blog();
    return $link;
}