Make WordPress Core

Ticket #17862: 17862.diff

File 17862.diff, 2.2 KB (added by scribu, 14 years ago)
  • wp-includes/comment.php

     
    13551355                $post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment
    13561356
    13571357                if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) )
    1358                         wp_notify_postauthor($comment_ID, isset( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' );
     1358                        wp_notify_postauthor( $comment_ID );
    13591359        }
    13601360
    13611361        return $comment_ID;
     
    13911391                case '1':
    13921392                        $status = '1';
    13931393                        if ( get_option('comments_notify') ) {
    1394                                 $comment = get_comment($comment_id);
    1395                                 wp_notify_postauthor($comment_id, $comment->comment_type);
     1394                                wp_notify_postauthor( $comment_id );
    13961395                        }
    13971396                        break;
    13981397                case 'spam':
  • wp-includes/pluggable.php

     
    10401040 * @since 1.0.0
    10411041 *
    10421042 * @param int $comment_id Comment ID
    1043  * @param string $comment_type Optional. The comment type either 'comment' (default), 'trackback', or 'pingback'
     1043 * @param string $deprecated Not used
    10441044 * @return bool False if user email does not exist. True on completion.
    10451045 */
    1046 function wp_notify_postauthor( $comment_id, $comment_type = '' ) {
     1046function wp_notify_postauthor( $comment_id, $deprecated = null ) {
     1047        if ( null !== $deprecated )
     1048                _deprecated_argument( __FUNCTION__, '3.3' );
     1049
    10471050        $comment = get_comment( $comment_id );
    10481051        $post    = get_post( $comment->comment_post_ID );
    10491052        $author  = get_userdata( $post->post_author );
     
    10661069        // we want to reverse this for the plain text arena of emails.
    10671070        $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    10681071
    1069         if ( empty( $comment_type ) ) $comment_type = 'comment';
     1072        $comment_type = $comment->comment_type ? $comment->comment_type : 'comment';
    10701073
    10711074        if ('comment' == $comment_type) {
    10721075                $notify_message  = sprintf( __( 'New comment on your post "%s"' ), $post->post_title ) . "\r\n";