Returns

Source

functionbulk_delete_comments($comment_ids){if(count($comment_ids)<1){returnnewWP_Error('empty_comment_ids','The request must include comment_ids',400);}$results=array();foreach($comment_idsas$comment_id){if(!current_user_can('edit_comment',$comment_id)){continue;}if(wp_delete_comment($comment_id)){$results[]=$comment_id;}}return$results;}