HOOK_ARTICLE_IMAGE: stop after first provided match
This commit is contained in:
parent
518e677a6b
commit
72c04123d4
|
@ -550,8 +550,11 @@ class Article extends Handler_Protected {
|
||||||
$article_kind = 0;
|
$article_kind = 0;
|
||||||
|
|
||||||
PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_ARTICLE_IMAGE,
|
PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_ARTICLE_IMAGE,
|
||||||
function ($result) use (&$article_image, &$article_stream, &$content) {
|
function ($result, $plugin) use (&$article_image, &$article_stream, &$content) {
|
||||||
list ($article_image, $article_stream, $content) = $result;
|
list ($article_image, $article_stream, $content) = $result;
|
||||||
|
|
||||||
|
// run until first hard match
|
||||||
|
return !empty($article_image);
|
||||||
},
|
},
|
||||||
$enclosures, $content, $site_url, $headline);
|
$enclosures, $content, $site_url, $headline);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue