From 9e625130958db57caf886ccc211399fb5d6ae921 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 20 Dec 2020 13:12:50 +0300 Subject: [PATCH] af_redditimgur: also rewrite in the API handler --- plugins/af_redditimgur/init.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index 68893ea07..7a6f4b74d 100755 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -23,6 +23,7 @@ class Af_RedditImgur extends Plugin { $host->add_hook($host::HOOK_RENDER_ARTICLE, $this); $host->add_hook($host::HOOK_RENDER_ARTICLE_CDM, $this); + $host->add_hook($host::HOOK_RENDER_ARTICLE_API, $this); } function hook_prefs_tab($args) { @@ -636,4 +637,10 @@ class Af_RedditImgur extends Plugin { return $article; } + function hook_render_article_api($params) { + $article = isset($params["article"]) ? $params["article"] : $params["headline"]; + + return $this->hook_render_article_cdm($article); + } + }