deal with published hook in _create_published_article

This commit is contained in:
Andrew Dolgov 2025-05-02 08:26:52 +03:00
parent 5f70e41118
commit 0520ca2226
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A

View File

@ -98,6 +98,8 @@ class Article extends Handler_Protected {
int_id = ? AND owner_uid = ?"); int_id = ? AND owner_uid = ?");
$sth->execute([$int_id, $owner_uid]); $sth->execute([$int_id, $owner_uid]);
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_PUBLISHED, [$ref_id]);
} else { } else {
$sth = $pdo->prepare("INSERT INTO ttrss_user_entries $sth = $pdo->prepare("INSERT INTO ttrss_user_entries
@ -106,6 +108,8 @@ class Article extends Handler_Protected {
VALUES VALUES
(?, '', NULL, NULL, ?, true, '', '', NOW(), '', false, NOW())"); (?, '', NULL, NULL, ?, true, '', '', NOW(), '', false, NOW())");
$sth->execute([$ref_id, $owner_uid]); $sth->execute([$ref_id, $owner_uid]);
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_PUBLISHED, [$ref_id]);
} }
if (count($labels) != 0) { if (count($labels) != 0) {
@ -144,6 +148,8 @@ class Article extends Handler_Protected {
(?, '', NULL, NULL, ?, true, '', '', NOW(), '', false, NOW())"); (?, '', NULL, NULL, ?, true, '', '', NOW(), '', false, NOW())");
$sth->execute([$ref_id, $owner_uid]); $sth->execute([$ref_id, $owner_uid]);
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_PUBLISHED, [$ref_id]);
if (count($labels) != 0) { if (count($labels) != 0) {
foreach ($labels as $label) { foreach ($labels as $label) {
Labels::add_article($ref_id, trim($label), $owner_uid); Labels::add_article($ref_id, trim($label), $owner_uid);