aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggEntity.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/classes/ElggEntity.php')
-rw-r--r--engine/classes/ElggEntity.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php
index 79b8c2a4e..8fc1e46cb 100644
--- a/engine/classes/ElggEntity.php
+++ b/engine/classes/ElggEntity.php
@@ -850,12 +850,11 @@ abstract class ElggEntity extends ElggData implements
* @since 1.8.0
*/
function countComments() {
- $type = $this->getType();
$params = array('entity' => $this);
- $number = elgg_trigger_plugin_hook('comments:count', $type, $params, false);
+ $num = trigger_plugin_hook('comments:count', $this->getType(), $params);
- if ($number) {
- return $number;
+ if (is_int($num)) {
+ return $num;
} else {
return $this->getAnnotationCalculation('generic_comment', 'count');
}