# Data_Access::insert_comment()

Insert comment.

```php
insert_comment( int $post_id, int $user_id, string $content, ?int $parent_id = null )
```

## Parameters

- `$post_id` (int) Post ID.
- `$user_id` (int) Author.
- `$content` (string) Content.
- `$parent_id` (int|null) Parent comment ID.

## Return

`int|\WP_Error`
