mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 18:55:55 +00:00
Added HOOK_FORMAT_ENCLOSURES plugin hook.
Runs HTML and enclosures array through a plugin hook when rendering an article's enclosures in format_article_enclosures(). Allows plugins to override handling of how enclosures are presented by either filtering the array of enclosures, or generating the HTML to add to the article content.
This commit is contained in:
@@ -1846,8 +1846,17 @@
|
||||
$result = get_article_enclosures($id);
|
||||
$rv = '';
|
||||
|
||||
if (count($result) > 0) {
|
||||
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_FORMAT_ENCLOSURES) as $plugin) {
|
||||
$retval = $plugin->hook_format_enclosures($rv, $result, $id, $always_display_enclosures, $article_content, $hide_images);
|
||||
if (is_array($retval)) {
|
||||
$rv = $retval[0];
|
||||
$result = $retval[1];
|
||||
} else {
|
||||
$rv = $retval;
|
||||
}
|
||||
}
|
||||
|
||||
if ($rv === '' && is_array($result)) {
|
||||
$entries_html = array();
|
||||
$entries = array();
|
||||
$entries_inline = array();
|
||||
|
||||
Reference in New Issue
Block a user