why can’t I retrieve the comment ID?
So @Jack Johansson and @Dave Romsey helped me to make it work.So I will put the solution here: function ji_update_comment_date($comment,$commentarr){ $comment = get_comment( $comment ); $commentarr = array( ‘comment_ID’=>$comment->comment_ID, ‘comment_date’=>date(“Y-m-d H:i:s”), ‘comment_date_gmt’=> date(“Y-m-d H:i:s”) ); wp_update_comment( $commentarr );} add_action(‘comment_unapproved_to_approved’,’ji_update_comment_date’); I don’t understand why comment_ID() and get_comment_ID() won’t work in this scenario. But get_comment is surely … Read more