久久精品水蜜桃av综合天堂,久久精品丝袜高跟鞋,精品国产肉丝袜久久,国产一区二区三区色噜噜,黑人video粗暴亚裔

WordPress:WPMU Functions/get blog post

來自站長百科
Xxf3325討論 | 貢獻(xiàn)2008年9月26日 (五) 14:24的版本 (新頁面: Get Blog Post returns an object of the requested post. == The Function == function get_blog_post( $blog_id, $post_id ) { global $wpdb; $key = $blog_id."-".$post_id."-blog_post"; ...)
(差異) ←上一版本 | 最后版本 (差異) | 下一版本→ (差異)
跳轉(zhuǎn)至: 導(dǎo)航、? 搜索

Get Blog Post returns an object of the requested post.

The Function

function get_blog_post( $blog_id, $post_id ) {
  global $wpdb;
  $key = $blog_id."-".$post_id."-blog_post";
  $post = wp_cache_get( $key, "site-options" );
  if( $post == false ) {
    $post = $wpdb->get_row( "SELECT * FROM {$wpdb->base_prefix}{$blog_id}_posts WHERE ID = '{$post_id}'" );
    wp_cache_add( $key, $post, "site-options", 120 );
  }
  return $post;
}

The Returned Post

stdClass Object
(
   [ID] => 5
   [post_author] => 3
   [post_date] => 2008-07-06 14:38:58
   [post_date_gmt] => 2008-07-06 21:38:58
   [post_content] => [raw input text of the post]
   [post_title] => [title]
   [post_category] => 0
   [post_excerpt] => 
   [post_status] => publish
   [comment_status] => open
   [ping_status] => open
   [post_password] => 
   [post_name] => 5
   [to_ping] => 
   [pinged] => 
   [post_modified] => 2008-07-06 14:39:20
   [post_modified_gmt] => 2008-07-06 21:39:20
   [post_content_filtered] => 
   [post_parent] => 0
   [guid] => http://mu.samplesite.net/exampleblog/?p=[ID]
   [menu_order] => 0
   [post_type] => post
   [post_mime_type] => 
   [comment_count] => 0
)

--Unifex 21:57, 6 July 2008 (UTC)


Return to WordPress:WPMU_Functions