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

git-svn-id: https://develop.svn.wordpress.org/trunk@3013 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-11-07 23:15:21 +00:00
parent 0069470818
commit e908ebc95c
1 changed files with 2 additions and 2 deletions

View File

@ -243,8 +243,8 @@ if ( ! function_exists('wp_notify_postauthor') ) :
function wp_notify_postauthor($comment_id, $comment_type='') {
global $wpdb;
$comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
$post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = '$comment->comment_post_ID' LIMIT 1");
$comment = get_comment($comment_id);
$post = get_post($comment->comment_post_ID);
$user = get_userdata( $post->post_author );
if ('' == $user->user_email) return false; // If there's no email to send the comment to