-
-
Save DavidPeralvarez/504e219063f501395a4ec5337712333e to your computer and use it in GitHub Desktop.
Lesson Reply Notification 4
This file contains 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 | |
/* | |
Plugin Name: Lesson Reply Notification | |
Description: Send and email to the student, when he receives a response | |
Author: David Perálvarez | |
Version: 1.0 | |
Author URI: https://silicodevalley.com | |
*/ | |
add_action( 'wp_insert_comment', 'scv_comment_notification', 99, 2 ); | |
function scv_comment_notification( $commentId, $comment ) { | |
if (($comment->comment_approved == 1) && ($comment->comment_parent > 0)) { | |
$parent = get_comment($comment->comment_parent); | |
$email = $parent->comment_author_email; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment