Make WordPress Core


Ignore:
Timestamp:
01/27/2020 04:31:48 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Comments: Add In reply to: %s parent comment link to new comment email notifications.

This information was previously available on the Moderate Comment screen in the admin, but was missing from moderation emails.

Props imath, danieltj, andraganescu, galbaras, SergeyBiryukov.
Fixes #43805. See #43429.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/pluggable.php

    r47086 r47114  
    15851585                $subject = sprintf( __( '[%1$s] Trackback: "%2$s"' ), $blogname, $post->post_title );
    15861586                break;
     1587
    15871588            case 'pingback':
    15881589                /* translators: %s: Post title. */
     
    15981599                $subject = sprintf( __( '[%1$s] Pingback: "%2$s"' ), $blogname, $post->post_title );
    15991600                break;
     1601
    16001602            default: // Comments
    16011603                /* translators: %s: Post title. */
     
    16071609                /* translators: %s: Trackback/pingback/comment author URL. */
    16081610                $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
     1611
     1612                if ( $comment->comment_parent && user_can( $post->post_author, 'edit_comment', $comment->comment_parent ) ) {
     1613                    /* translators: Comment moderation. %s: Parent comment edit URL. */
     1614                    $notify_message .= sprintf( __( 'In reply to: %s' ), admin_url( "comment.php?action=editcomment&c={$comment->comment_parent}#wpbody-content" ) ) . "\r\n";
     1615                }
     1616
    16091617                /* translators: %s: Comment text. */
    16101618                $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
     
    16141622                break;
    16151623        }
     1624
    16161625        $notify_message .= get_permalink( $comment->comment_post_ID ) . "#comments\r\n\r\n";
    16171626        /* translators: %s: Comment URL. */
     
    17621771                $notify_message .= __( 'Trackback excerpt: ' ) . "\r\n" . $comment_content . "\r\n\r\n";
    17631772                break;
     1773
    17641774            case 'pingback':
    17651775                /* translators: %s: Post title. */
     
    17721782                $notify_message .= __( 'Pingback excerpt: ' ) . "\r\n" . $comment_content . "\r\n\r\n";
    17731783                break;
     1784
    17741785            default: // Comments
    17751786                /* translators: %s: Post title. */
     
    17821793                /* translators: %s: Trackback/pingback/comment author URL. */
    17831794                $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
     1795
     1796                if ( $comment->comment_parent ) {
     1797                    /* translators: Comment moderation. %s: Parent comment edit URL. */
     1798                    $notify_message .= sprintf( __( 'In reply to: %s' ), admin_url( "comment.php?action=editcomment&c={$comment->comment_parent}#wpbody-content" ) ) . "\r\n";
     1799                }
     1800
    17841801                /* translators: %s: Comment text. */
    17851802                $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
Note: See TracChangeset for help on using the changeset viewer.