update_post_meta not working with transition_comment_status
You have typo error in $post->ID as you don’t have $post variable, and it really could cause you feel that it doesn’t work, at least it will not calculate new value. So here’s modified approach. I’ve also used different hooks to trigger action when it’s really necessary and not for every comment_status transition. /** * … Read more