in WORDPRESS, when need to add comment use this function:
wp_insert_comment();
but, after add the comment, I need to add reply to comment programmatically, there is way for this?
in WORDPRESS, when need to add comment use this function:
wp_insert_comment();
but, after add the comment, I need to add reply to comment programmatically, there is way for this?
2
Answers
You could hook into wp_insert_comment and just ignore a specific user of the comment id if their role is administrator. For example;
The WP_Comment Object has a parent property on it. Give the ID of the comment you’re replying to, as the parent ID for this comment.
We can use the wp_update_comment() function to update a comment array with all the data we need.
https://developer.wordpress.org/reference/functions/wp_update_comment/