# Comment

### Properties

<table><thead><tr><th width="633">Property</th><th>Type</th></tr></thead><tbody><tr><td>ID</td><td>int</td></tr><tr><td>agent</td><td>string</td></tr><tr><td>approved</td><td>bool</td></tr><tr><td>post_ID</td><td>int</td></tr><tr><td>author</td><td>string</td></tr><tr><td>author_email</td><td>string</td></tr><tr><td>author_IP</td><td>string</td></tr><tr><td>author_url</td><td>string</td></tr><tr><td>content</td><td>string</td></tr><tr><td>date</td><td>string</td></tr><tr><td>date_gmt</td><td>string</td></tr><tr><td>karma</td><td>int</td></tr><tr><td>parent</td><td>object</td></tr><tr><td>post</td><td>object</td></tr><tr><td>replies</td><td>array</td></tr><tr><td>user</td><td>object</td></tr></tbody></table>

## Examples

#### Handle submission

Handles the submission of a comment, see [wp\_handle\_comment\_submission](https://developer.wordpress.org/reference/functions/wp_handle_comment_submission/)

In an API Controller

```php
$status = Comment::handleSubmission($_POST);
```

#### Display comments

```liquid
{% if post.comment_count %}
<ol class="comment-list">
    {% for comment in post.comments %}
    <li id="comment-{{ comment.ID }}"
        class="comment {{ loop.index is odd ? 'odd thread-odd' : 'even thread-even' }} depth-1 parent">
        <article id="div-comment-{{ comment.ID }}" class="comment-body">
            <footer class="comment-meta">
                <div class="comment-author vcard">
                    <b class="fn">{{ comment.author }}</b>
                </div>
                <div class="comment-metadata">
                    <time datetime="{{ comment.date_gmt }}">{{ comment.date }}</time>
                </div>
            </footer>
            <div class="comment-content">{{ comment.content|raw }}</div>
        </article>

        <div class="comment-reply">
            {% if user %}
            <a rel="nofollow" class="comment-reply-link" href="">
                {{ __( 'Reply to %s' )|format(comment.author) }}
            </a>
            {% else %}
            <a rel="nofollow" class="comment-reply-login" href="{{ login_url(post.link) }}">
                {{ __( 'Log in to Reply' ) }}
            </a>
            {% endif %}
        </div>

        {% if comment.replies|length %}
        <ol class="children">
            {% for reply in comment.replies %}
            <li id="comment-{{ reply.ID }}" class="comment {{ loop.index is odd ? 'odd' : 'even' }} alt depth-{{ depth+1 }}">
                ...
            </li>
            {% endfor %}
        </ol>
        {% endif %}
    </li>
    {% endfor %}
</ol>
{% endif %}
```
