Make WordPress Core

Ticket #6892: notify-on-approve.patch

File notify-on-approve.patch, 613 bytes (added by chmac, 18 years ago)

My second patch passed the wrong variable for the $comment_id - I've tested this patch and it works on my install.

  • wp-includes/comment.php

     
    725725                        break;
    726726                case 'approve':
    727727                        $query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID = %d LIMIT 1", $comment_id);
     728                        if ( get_option( 'comments_notify' ) == true ) {
     729                                wp_notify_postauthor( $comment_id );
     730                        }
    728731                        break;
    729732                case 'spam':
    730733                        $query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID = %d LIMIT 1", $comment_id);