mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-26 22:32:52 +02:00
Fix duplicate comment notifications. Props MtDewVirus. fixes #6892 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
eb60fb288d
commit
f57354bf63
@ -193,10 +193,6 @@ case 'approvecomment' :
|
|||||||
|
|
||||||
wp_set_comment_status( $comment->comment_ID, 'approve' );
|
wp_set_comment_status( $comment->comment_ID, 'approve' );
|
||||||
|
|
||||||
if ( true == get_option('comments_notify') )
|
|
||||||
wp_notify_postauthor( $comment->comment_ID );
|
|
||||||
|
|
||||||
|
|
||||||
if ( '' != wp_get_referer() && false == $noredir )
|
if ( '' != wp_get_referer() && false == $noredir )
|
||||||
wp_redirect( wp_get_referer() );
|
wp_redirect( wp_get_referer() );
|
||||||
else
|
else
|
||||||
|
@ -734,8 +734,10 @@ function wp_set_comment_status($comment_id, $comment_status) {
|
|||||||
break;
|
break;
|
||||||
case 'approve':
|
case 'approve':
|
||||||
$query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID = %d LIMIT 1", $comment_id);
|
$query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID = %d LIMIT 1", $comment_id);
|
||||||
if ( get_option( 'comments_notify' ) == true )
|
if ( get_option('comments_notify') ) {
|
||||||
wp_notify_postauthor( $comment_id );
|
$comment = get_comment($comment_id);
|
||||||
|
wp_notify_postauthor($comment_id, $comment->comment_type);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'spam':
|
case 'spam':
|
||||||
$query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID = %d LIMIT 1", $comment_id);
|
$query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID = %d LIMIT 1", $comment_id);
|
||||||
|
Loading…
Reference in New Issue
Block a user