diff options
author | Andrew Dolgov <[email protected]> | 2021-02-08 16:14:48 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-08 16:14:48 +0300 |
commit | 3b52cea8110541e1e5d8cb06198c11a2ed074b1c (patch) | |
tree | 763304f562f8787fa2e56291d032832981b5c436 /classes/pref | |
parent | 1d5c8ee50082dd0221055969283b27f2b09b3bb4 (diff) |
move some old-style handlers to new callback ones
Diffstat (limited to 'classes/pref')
-rwxr-xr-x | classes/pref/filters.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/classes/pref/filters.php b/classes/pref/filters.php index 11702103a..43a625989 100755 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -140,9 +140,13 @@ class Pref_Filters extends Handler_Protected { $line["content_preview"] = truncate_string(strip_tags($line["content"]), 200, '…'); - foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { - $line = $p->hook_query_headlines($line, 100); - } + $excerpt_length = 100; + + PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_QUERY_HEADLINES, + function ($result) use (&$line) { + $line = $result; + }, + $line, $excerpt_length); $content_preview = $line["content_preview"]; |