Habari\Comments::count_by_id PHP Method

count_by_id() public static method

returns the number of comments attached to the specified post
public static count_by_id ( integer $id, integer | string $status = 'approved' ) : integer
$id integer a post ID
$status integer | string A comment status value, or false to not filter on status(default: 'approved')
return integer a count of the comments attached to the specified post
    public static function count_by_id($id = 0, $status = 'approved')
    {
        $params = array('post_id' => $id, 'count' => 'id');
        if (false !== $status) {
            $params['status'] = $status;
        }
        return self::get($params);
    }