aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorM. Dent <dentm42@gmail.com>2019-11-03 10:12:11 +0100
committerMario <mario@mariovavti.com>2019-11-03 10:12:11 +0100
commit707b19dc35160983694b21e5e79dd7ce6d64dfee (patch)
tree5ad172a9f06e31f6e360d535427e7dd76d8b050a /include/items.php
parent6fd15d66a7a0eb1aaac476e2d25cfea174d0cd81 (diff)
downloadvolse-hubzilla-707b19dc35160983694b21e5e79dd7ce6d64dfee.tar.gz
volse-hubzilla-707b19dc35160983694b21e5e79dd7ce6d64dfee.tar.bz2
volse-hubzilla-707b19dc35160983694b21e5e79dd7ce6d64dfee.zip
Add hook to comments_are_now_closed()
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index 6786b8b05..917808ad5 100755
--- a/include/items.php
+++ b/include/items.php
@@ -206,6 +206,25 @@ function collect_recipients($item, &$private_envelope,$include_groups = true) {
}
function comments_are_now_closed($item) {
+
+ $x = [
+ 'item' => $item,
+ 'closed' => 'unset'
+ ];
+
+ /**
+ * @hooks comments_are_now_closed
+ * Called to determine whether commenting should be closed
+ * * \e array \b item
+ * * \e boolean \b closed - return value
+ */
+
+ call_hooks('comments_are_now_closed', $x);
+
+ if ($x['closed'] != 'unset') {
+ return $x['closed'];
+ }
+
if($item['comments_closed'] > NULL_DATE) {
$d = datetime_convert();
if($d > $item['comments_closed'])