add plugin hooks invoked when articles get un/marked or un/published

This commit is contained in:
Andrew Dolgov
2025-05-01 22:36:33 +03:00
parent 4ae17d0f1c
commit 5f70e41118
5 changed files with 45 additions and 0 deletions

View File

@@ -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",