Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_blog_permalink [ WordPress Function ]

get_blog_permalink ( $_blog_id, $post_id )
Parameters:
  • (int) $_blog_id ID of the source blog.
  • (int) $post_id ID of the desired post.
Returns:
  • (string) The post's permalink
Defined at:



Get the permalink for a post on another blog.

Source


<?php
function get_blog_permalink$_blog_id$post_id ) {
    
$key "{$_blog_id}-{$post_id}-blog_permalink";
    
$link wp_cache_get$key'site-options' );
    if ( 
$link == false ) {
        
switch_to_blog$_blog_id );
        
$link get_permalink$post_id );
        
restore_current_blog();
        
wp_cache_add$key$link'site-options'360 );
    }
    return 
$link;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics