get_blog_permalink

函式
get_blog_permalink ( $blog_id, $post_id )
引數
  • (int) $blog_id ID of the source blog.
    Required:
  • (int) $post_id ID of the desired post.
    Required:
返回值
  • (string) The post's permalink
定義位置
相關方法
get_permalinkget_post_permalinkget_the_permalinkget_sample_permalinkget_blog_option
引入
-
棄用
-

get_blog_permink:根據站點的ID或域/路徑組合檢索網路中站點的固定連結結構。

獲取另一個部落格上的文章的固定連結。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_blog_permalink( $blog_id, $post_id ) {
switch_to_blog( $blog_id );
$link = get_permalink( $post_id );
restore_current_blog();
return $link;
}
function get_blog_permalink( $blog_id, $post_id ) { switch_to_blog( $blog_id ); $link = get_permalink( $post_id ); restore_current_blog(); return $link; }
function get_blog_permalink( $blog_id, $post_id ) {
	switch_to_blog( $blog_id );
	$link = get_permalink( $post_id );
	restore_current_blog();

	return $link;
}

常見問題

FAQs
檢視更多 >