Hello forum. I am trying to make the following “plugin” to just send emails when a comment is made on the attachment page.
I tried putting the function code inside an if is_attachemnt condition and it doesn’t work either…
Does anyone knows the right way?
Thanks
function notify($comment_id) {
$user_email = 'example@gmail.com';
$subject = $comment_id . get_option('blogname');
$t1 = 'Someone commented on a your picture';
$t2 = "click here to see the comment";
text = $t1 . $t2;
wp_mail( $user_email, $subject, $text );
}
add_action('comment_post', 'notify');