From 3b52cea8110541e1e5d8cb06198c11a2ed074b1c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 8 Feb 2021 16:14:48 +0300 Subject: move some old-style handlers to new callback ones --- classes/article.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'classes/article.php') diff --git a/classes/article.php b/classes/article.php index ff7f11180..de39f05d9 100755 --- a/classes/article.php +++ b/classes/article.php @@ -31,14 +31,14 @@ class Article extends Handler_Protected { $pluginhost->load_all(PluginHost::KIND_ALL, $owner_uid); //$pluginhost->load_data(); - foreach ($pluginhost->get_hooks(PluginHost::HOOK_GET_FULL_TEXT) as $p) { - $extracted_content = $p->hook_get_full_text($url); - - if ($extracted_content) { - $content = $extracted_content; - break; - } - } + $pluginhost->run_hooks_callback(PluginHost::HOOK_GET_FULL_TEXT, + function ($result) use (&$content) { + if ($result) { + $content = $result; + return true; + } + }, + $url); } $content_hash = sha1($content); -- cgit v1.2.3