WordPress.org

Make WordPress Core

Ticket #14907: correct_notify_postauthor.patch

File correct_notify_postauthor.patch, 747 bytes (added by solarissmoke, 5 years ago)

Check for !empty() instead of empty()

  • wp/wp-includes/comment.php

     
    12821282                $post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment 
    12831283 
    12841284                if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) ) 
    1285                         wp_notify_postauthor($comment_ID, empty( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' ); 
     1285                        wp_notify_postauthor($comment_ID, !empty( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' ); 
    12861286        } 
    12871287 
    12881288        return $comment_ID;