[wp-hackers] Post title in comments feed in 1.5.2

Scott Merrill skippy at skippy.net
Mon Aug 15 22:37:30 GMT 2005


Alex King wrote:
> I submitted a patch for the comments feed that added the post title  to 
> the <title> element in the feed. The patch I submitted simply  added 
> p.post_title to the fields pulled from the posts table in the  LEFT JOIN.
> 
> I see this same functionality has been added to the comments feed in  
> 1.5.2, but in a different way. Instead of grabbing the p.post_title  in 
> the JOIN, the code looks this:
> 
>  $title = get_the_title($comment->comment_post_ID);
> 
> which, as I read it, will generate a query just to get the title of  the 
> post for each comment.
> 
> Is there a reason this was done?

The offending code is from a patch I submitted:
http://trac.wordpress.org/ticket/1282

My understanding of the flow is that get_the_title() will call 
get_post(), and get_post will rely on the post cache.  RSS feeds should 
be using the post cache in their Loops, shouldn't they?

-- 
skippy at skippy.net | http://skippy.net/

gpg --keyserver pgp.mit.edu --recv-keys 9CFA4B35
506C F8BB 17AE 8A05 0B49  3544 476A 7DEC 9CFA 4B35


More information about the wp-hackers mailing list