diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2025-05-02 18:40:47 +0000 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2025-05-02 18:40:47 +0000 |
| commit | bc0da8edb699eec9fb6424bb5d8650ac48dca69d (patch) | |
| tree | 1433d63b437b719bca1f11f9b6a605352aac3677 /classes/API.php | |
| parent | 4ae17d0f1c956bfe392653ab847eb2e3da6f7bfc (diff) | |
| parent | 3098dc0a163b4b70105da2eae1237057ae97ccb1 (diff) | |
Merge branch 'marked-hook' into 'master'
add plugin hooks invoked when articles get un/marked or un/published
See merge request tt-rss/tt-rss!123
Diffstat (limited to 'classes/API.php')
| -rw-r--r-- | classes/API.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/classes/API.php b/classes/API.php index 72c65ea54..6db05198a 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_MARK_TOGGLED, $article_ids); + + if ($field == 'published') + PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_PUBLISH_TOGGLED, $article_ids); + $num_updated = $sth->rowCount(); return $this->_wrap(self::STATUS_OK, array("status" => "OK", |