summaryrefslogtreecommitdiff
path: root/classes/article.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-08 21:06:14 +0300
committerAndrew Dolgov <[email protected]>2021-02-08 21:06:14 +0300
commita14873d5b4bde01f1470db5a2bb0d49ac0c8cd3c (patch)
treebe060a8ac6fb2395bb3798026947d85b1adc6442 /classes/article.php
parent54bbd08f38bb6e766df3122e8ad0f22f5297839b (diff)
more hooks, also add type hint for PluginHost::getInstance()
Diffstat (limited to 'classes/article.php')
-rwxr-xr-xclasses/article.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/classes/article.php b/classes/article.php
index a79241bf6..6729443a1 100755
--- a/classes/article.php
+++ b/classes/article.php
@@ -731,9 +731,11 @@ class Article extends Handler_Protected {
define('ARTICLE_KIND_VIDEO', 2);
define('ARTICLE_KIND_YOUTUBE', 3);
- foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_IMAGE) as $p) {
- list ($article_image, $article_stream, $content) = $p->hook_article_image($enclosures, $content, $site_url);
- }
+ PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_ARTICLE_IMAGE,
+ function ($result) use (&$article_image, &$article_stream, &$content) {
+ list ($article_image, $article_stream, $content) = $result;
+ },
+ $enclosures, $content, $site_url);
if (!$article_image && !$article_stream) {
$tmpdoc = new DOMDocument();