I’m looking to send out emails to subscribers when a comment has been approved.
The two actions in the Codex are:
1.
add_action('comment_post', 'callback', $priority, $accepted_args);
Where the arguments are comment_ID
and approval status
(0 or 1).
2.
add_action('edit_comment', 'callback', $priority, $accepted_args);
With argument comment_ID
By default comments are not approved when they are posted so I think I would be editing them when I approve them but it’s unclear in the Codex. Which option should I use when I approve a comment?
Just like posts, a comment can have an array of different statuses, so instead of naming a hook with each status, they have transition hooks, which tell you what status it had before and what’s the new status. In your case, this might do the trick:
Let us know how it goes?