get_blog_permalink

Advertisement

Summery Summery

Get the permalink for a post on another blog.

Syntax Syntax

get_blog_permalink( int $blog_id, int $post_id )

Parameters Parameters

$blog_id

(Required) ID of the source blog.

$post_id

(Required) ID of the desired post.

Return Return

(string) The post's permalink

Source Source

File: wp-includes/ms-functions.php

 * @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();

Advertisement

Changelog Changelog

Changelog
Version Description
MU (3.0.0) 1.0 Introduced.

Advertisement

Leave a Reply