aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/elgglib.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index d4feabf53..f810cc8ca 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -481,7 +481,17 @@
return $comments;
}
-
+
+ /**
+ * Count the number of comments attached to an entity
+ *
+ * @param ElggEntity $entity
+ * @return int Number of comments
+ */
+ function elgg_count_comments($entity) {
+ return count_annotations($entity_guid, "", "", $name);
+ }
+
/**
* Wrapper function to display search listings.
*