Hi,
It also depends upon your WordPress comment approval policy. usually, if the user has previously approved comments, the submitted comment is automatically approved. please check your WordPress > Settings > Discussion.
Thread Starter
ako21
(@ako21)
Actually the problem is with the plugin itself. Setting comment_status to 0 was throwing an error. So I modified the json-api-user/controllers/User.php file to this:
$data = array(
'comment_post_ID' => $json_api->query->post_id,
'comment_author' => $user_info->user_login,
'comment_author_email' => $user_info->user_email,
'comment_author_url' => $user_info->user_url,
'comment_content' => $json_api->query->content,
'comment_type' => '',
'comment_parent' => 0,
'user_id' => $user_info->ID,
'comment_author_IP' => $ip,
'comment_agent' => $agent,
'comment_date' => $time,
'comment_approved' => 0,
);
instead of:
$data = array(
'comment_post_ID' => $json_api->query->post_id,
'comment_author' => $user_info->user_login,
'comment_author_email' => $user_info->user_email,
'comment_author_url' => $user_info->user_url,
'comment_content' => $json_api->query->content,
'comment_type' => '',
'comment_parent' => 0,
'user_id' => $user_info->ID,
'comment_author_IP' => $ip,
'comment_agent' => $agent,
'comment_date' => $time,
'comment_approved' => $comment_approved,
);
Note how comment_approved has been set to 0.
Cheers! 🙂