Skip to content
Snippets Groups Projects
Commit a14873d5 authored by Andrew Dolgov's avatar Andrew Dolgov
Browse files

more hooks, also add type hint for PluginHost::getInstance()

parent 54bbd08f
No related branches found
No related tags found
No related merge requests found
...@@ -731,9 +731,11 @@ class Article extends Handler_Protected { ...@@ -731,9 +731,11 @@ class Article extends Handler_Protected {
define('ARTICLE_KIND_VIDEO', 2); define('ARTICLE_KIND_VIDEO', 2);
define('ARTICLE_KIND_YOUTUBE', 3); define('ARTICLE_KIND_YOUTUBE', 3);
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_IMAGE) as $p) { PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_ARTICLE_IMAGE,
list ($article_image, $article_stream, $content) = $p->hook_article_image($enclosures, $content, $site_url); function ($result) use (&$article_image, &$article_stream, &$content) {
} list ($article_image, $article_stream, $content) = $result;
},
$enclosures, $content, $site_url);
if (!$article_image && !$article_stream) { if (!$article_image && !$article_stream) {
$tmpdoc = new DOMDocument(); $tmpdoc = new DOMDocument();
......
...@@ -90,7 +90,7 @@ class PluginHost { ...@@ -90,7 +90,7 @@ class PluginHost {
// //
} }
public static function getInstance() { public static function getInstance(): PluginHost {
if (self::$instance == null) if (self::$instance == null)
self::$instance = new self(); self::$instance = new self();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment