[wp-cvs] wordpress/wp-includes functions.php,1.252,1.253

Ryan Boren rboren at users.sourceforge.net
Sun Feb 6 18:21:24 GMT 2005


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6606

Modified Files:
	functions.php 
Log Message:
Do some caching in get_postdata().

Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.252
retrieving revision 1.253
diff -C2 -d -r1.252 -r1.253
*** functions.php	6 Feb 2005 06:13:26 -0000	1.252
--- functions.php	6 Feb 2005 18:21:20 -0000	1.253
***************
*** 526,546 ****
  	global $post, $wpdb;
  
! 	$post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = '$postid'");
  	
  	$postdata = array (
! 		'ID' => $post->ID, 
! 		'Author_ID' => $post->post_author, 
! 		'Date' => $post->post_date, 
! 		'Content' => $post->post_content, 
! 		'Excerpt' => $post->post_excerpt, 
! 		'Title' => $post->post_title, 
! 		'Category' => $post->post_category,
! 		'post_status' => $post->post_status,
! 		'comment_status' => $post->comment_status,
! 		'ping_status' => $post->ping_status,
! 		'post_password' => $post->post_password,
! 		'to_ping' => $post->to_ping,
! 		'pinged' => $post->pinged,
! 		'post_name' => $post->post_name
  	);
  	return $postdata;
--- 526,549 ----
  	global $post, $wpdb;
  
!  	if ( $postid == $post->ID )
!  		$a_post = $post;
!  	else 
! 		$a_post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = '$postid'");
  	
  	$postdata = array (
! 		'ID' => $a_post->ID, 
! 		'Author_ID' => $a_post->post_author, 
! 		'Date' => $a_post->post_date, 
! 		'Content' => $a_post->post_content, 
! 		'Excerpt' => $a_post->post_excerpt, 
! 		'Title' => $a_post->post_title, 
! 		'Category' => $a_post->post_category,
! 		'post_status' => $a_post->post_status,
! 		'comment_status' => $a_post->comment_status,
! 		'ping_status' => $a_post->ping_status,
! 		'post_password' => $a_post->post_password,
! 		'to_ping' => $a_post->to_ping,
! 		'pinged' => $a_post->pinged,
! 		'post_name' => $a_post->post_name
  	);
  	return $postdata;



More information about the cvs mailing list