aboutsummaryrefslogtreecommitdiff
path: root/classes/API.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/API.php
parent4ae17d0f1c956bfe392653ab847eb2e3da6f7bfc (diff)
add plugin hooks invoked when articles get un/marked or un/published
Diffstat (limited to 'classes/API.php')
-rw-r--r--classes/API.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/classes/API.php b/classes/API.php
index 72c65ea54..83eaa22b8 100644
--- a/classes/API.php
+++ b/classes/API.php
@@ -284,6 +284,12 @@ class API extends Handler {
WHERE ref_id IN ($article_qmarks) AND owner_uid = ?");
$sth->execute([...$article_ids, $_SESSION['uid']]);
+ if ($field == 'marked')
+ PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_MARKED, $article_ids);
+
+ if ($field == 'published')
+ PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_PUBLISHED, $article_ids);
+
$num_updated = $sth->rowCount();
return $this->_wrap(self::STATUS_OK, array("status" => "OK",