summaryrefslogtreecommitdiff
path: root/classes/RPC.php
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2025-05-01 22:36:33 +0300
committerAndrew Dolgov <fox@fakecake.org>2025-05-01 22:36:33 +0300
commit5f70e4111889ddf4b97a257abd81f94cac7bac8a (patch)
treefc3efcbf8c1854bfafe2dca51fbd25398bdef15a /classes/RPC.php
parent4ae17d0f1c956bfe392653ab847eb2e3da6f7bfc (diff)
add plugin hooks invoked when articles get un/marked or un/published
Diffstat (limited to 'classes/RPC.php')
-rw-r--r--classes/RPC.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/classes/RPC.php b/classes/RPC.php
index 031bef509..6b6f3e909 100644
--- a/classes/RPC.php
+++ b/classes/RPC.php
@@ -69,6 +69,8 @@ class RPC extends Handler_Protected {
$sth->execute([$mark, $id, $_SESSION['uid']]);
+ PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_MARKED, [$id]);
+
print json_encode(array("message" => "UPDATE_COUNTERS"));
}
@@ -95,6 +97,8 @@ class RPC extends Handler_Protected {
$sth->execute([$pub, $id, $_SESSION['uid']]);
+ PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_PUBLISHED, [$id]);
+
print json_encode(array("message" => "UPDATE_COUNTERS"));
}
@@ -345,6 +349,8 @@ class RPC extends Handler_Protected {
}
$sth->execute([...$ids, $_SESSION['uid']]);
+
+ PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_MARKED, $ids);
}
/**
@@ -369,6 +375,8 @@ class RPC extends Handler_Protected {
}
$sth->execute([...$ids, $_SESSION['uid']]);
+
+ PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_PUBLISHED, $ids);
}
function log(): void {