This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_set_comment_status', 'wi_comment_notification', 99, 2 ); | |
function wi_comment_notification( $comment_id, $comment_status ){ | |
$comment_object = get_comment( $comment_id ); | |
if( $comment_status == 'approve' && $comment_object->comment_parent > 0 ){ | |
$comment_parent = get_comment( $comment_object->comment_parent ); | |
$mailcontent = 'Hi ' . $comment_parent->comment_author . ',<br><br>'; | |
$mailcontent .= $comment_object->comment_author . ' replied to your comment on <a href="' . get_permalink( $comment_parent->comment_post_ID ) . '">' . get_the_title( $comment_parent->comment_post_ID ).'</a> with the following:'; | |
$mailcontent .= '<blockquote>' . $comment_object->comment_content . '</blockquote>'; |
OlderNewer