From 0520ca2226f095046eaf57aa8125e88f69ccf376 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 2 May 2025 08:26:52 +0300 Subject: [PATCH] deal with published hook in _create_published_article --- classes/Article.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/classes/Article.php b/classes/Article.php index bfff11e6b..6a3111892 100644 --- a/classes/Article.php +++ b/classes/Article.php @@ -98,6 +98,8 @@ class Article extends Handler_Protected { int_id = ? AND owner_uid = ?"); $sth->execute([$int_id, $owner_uid]); + PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_PUBLISHED, [$ref_id]); + } else { $sth = $pdo->prepare("INSERT INTO ttrss_user_entries @@ -106,6 +108,8 @@ class Article extends Handler_Protected { VALUES (?, '', NULL, NULL, ?, true, '', '', NOW(), '', false, NOW())"); $sth->execute([$ref_id, $owner_uid]); + + PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_PUBLISHED, [$ref_id]); } if (count($labels) != 0) { @@ -144,6 +148,8 @@ class Article extends Handler_Protected { (?, '', NULL, NULL, ?, true, '', '', NOW(), '', false, NOW())"); $sth->execute([$ref_id, $owner_uid]); + PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_PUBLISHED, [$ref_id]); + if (count($labels) != 0) { foreach ($labels as $label) { Labels::add_article($ref_id, trim($label), $owner_uid);