CommentField::getNumComments()
Get number of comments for Page, optionally limited by specific $options
Unlike the count() method this is focused on a specific Page and may be faster in cases where it matches what you need to count.
Available since version 3.0.153.
Usage
// basic usage
$int = $commentField->getNumComments(Page $page);
// usage with all arguments
$int = $commentField->getNumComments(Page $page, array $options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
$page | Page | |
$options (optional) | array |
|
Return value
int
CommentField methods and properties
API reference based on ProcessWire core version 3.0.251