Switch language

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




get_blog_post [ WordPress Function ]

get_blog_post ( $blog_id, $post_id )
Parameters:
  • (int) $blog_id ID of the blog.
  • (int) $post_id ID of the post you're looking for.
Returns:
  • (object) The post.
Defined at:



Get a blog post from any site on the network.

Source


<?php
function get_blog_post$blog_id$post_id ) {
    global 
$wpdb;

    
$key $blog_id '-' $post_id;
    
$post wp_cache_get$key'global-posts' );
    if ( 
$post == false ) {
        
$post $wpdb->get_row$wpdb->prepare'SELECT * FROM ' $wpdb->get_blog_prefix$blog_id ) . 'posts WHERE ID = %d'$post_id ) );
        
wp_cache_add$key$post'global-posts' );
    }

    return 
$post;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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