Make WordPress Core

Changeset 3013


Ignore:
Timestamp:
11/07/2005 11:15:21 PM (19 years ago)
Author:
ryan
Message:

Use get_*() API instead of SELECTs so that we hit the cache.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable-functions.php

    r3012 r3013  
    244244    global $wpdb;
    245245   
    246     $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
    247     $post    = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = '$comment->comment_post_ID' LIMIT 1");
     246    $comment = get_comment($comment_id);
     247    $post    = get_post($comment->comment_post_ID);
    248248    $user    = get_userdata( $post->post_author );
    249249
Note: See TracChangeset for help on using the changeset viewer.