wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



get_blog_post › WordPress Function

Od
Przestarzałyn/a
get_blog_post ( $blog_id, $post_id )
Parametry: (2)
  • (int) $blog_id ID of the blog.
    Wymagane: Tak
  • (int) $post_id ID of the post being looked for.
    Wymagane: Tak
Powrót:
  • (WP_Post|null) WP_Post object on success, null on failure
Zdefiniowane na:
Codex:
Dziennik zmian:
  • MU

Gets a blog post from any site on the network.

This function is similar to get_post(), except that it can retrieve a post from any site on the network, not just the current site.


Źródło

function get_blog_post( $blog_id, $post_id ) {
	switch_to_blog( $blog_id );
	$post = get_post( $post_id );
	restore_current_blog();

	return $post;
}