Running a function on comment status change
The comment_post hook is called with a $comment_id as the first argument. You can see why your function is failing. Same goes for the edit_comment hook. Simply add the following at the beginning of your business function: if ( !is_object( $comment ) ) $comment = get_comment( $comment ); Do use a custom SQL query for … Read more