WordPress.org

Make WordPress Core

Ticket #761: notifyhooks_comment-functions.diff

File notifyhooks_comment-functions.diff, 1.1 KB (added by coffee2code, 10 years ago)
  • comment-functions.php

    old new  
    624624    global $wpdb; 
    625625    global $querystring_start, $querystring_equal, $querystring_separator; 
    626626     
     627    $do_notify = apply_filters('notify_postauthor', $comment_id); 
     628    if (! $do_notify ) return false; 
     629 
    627630    $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1"); 
    628631    $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1"); 
    629632    $user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE ID='$post->post_author' LIMIT 1"); 
     
    690693 
    691694    if( get_settings( "moderation_notify" ) == 0 ) 
    692695        return true;  
     696 
     697    $do_notify = apply_filters('notify_moderator', $comment_id); 
     698    if (! $do_notify ) return true; 
    693699     
    694700    $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1"); 
    695701    $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");