Skip to content

Instantly share code, notes, and snippets.

Avatar

thesnippet.dev thesnippetdev

View GitHub Profile
View EmailNotificationForComments.php
<?php // remove before copy / paste
add_action('wp_insert_comment', 'email_notifications_for_comments', 99, 2);
function email_notifications_for_comments($comment_id, $comment_object) {
if ( ( $comment_object->comment_approved == 1 ) && ($comment_object->comment_parent > 0 ) ) {
$comment_parent = get_comment($comment_object->comment_parent);
$subject = '['.get_bloginfo().'] '.__('Comment Notification');