I have a function using the filter preprocess_comment
and want to use the update_comment_meta( $comment['comment_ID'], 'post_id', $post_id );
. However, the array in preprocess_comment doesn't have comment_ID
.
In looking at filters, I cannot find a different one to use for this function.
The function writes the comment to an external forum. This part of the function works but stops at the update_comment_meta
due to an error "duplicate" comment. In looking at the database, the comment_post_ID
is written to the database and not the comment_ID
.
In trying to understand this challenge, the comment_ID is not in the array. This makes since since it is "preprocess" of the comments and an ID would not be available. Is this correct?
Therefore how can I write to the _commentmeta
table so that the comment_ID is written and not the comment_Post_ID?
I've looked through hooks for comments but don't see anything that I can hook into so that comments are written to an external forum and allow the comment meta data to be updated.
Does anyone have any suggestions on the direction to take?
comment_ID
"written" but no thecomment_post_ID
? That doesn't make sense.