summaryrefslogtreecommitdiff
path: root/classes/api.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-15 08:28:46 +0300
committerAndrew Dolgov <[email protected]>2021-02-15 08:28:46 +0300
commita4604e892c0b8b78c5fa6ff508430cc5864e82d6 (patch)
treea8278cc18161167c88cb480adc13a4a1c0a694c5 /classes/api.php
parent3c584376ca24e4bc5220c8dac4f1e238a245e7fe (diff)
api: get flavor image from plugin-processed content
Diffstat (limited to 'classes/api.php')
-rwxr-xr-xclasses/api.php25
1 files changed, 14 insertions, 11 deletions
diff --git a/classes/api.php b/classes/api.php
index 9299c34ea..139b4d662 100755
--- a/classes/api.php
+++ b/classes/api.php
@@ -778,20 +778,23 @@ class API extends Handler {
$hook_object = ["headline" => &$headline_row];
- PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_RENDER_ARTICLE_API,
- function ($result) use (&$headline_row) {
- $headline_row = $result;
- },
- $hook_object);
+ if ($show_content) {
+ PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_RENDER_ARTICLE_API,
+ function ($result) use (&$headline_row) {
+ $headline_row = $result;
+ },
+ $hook_object);
- list ($flavor_image, $flavor_stream, $flavor_kind) = Article::get_article_image($enclosures, $line["content"], $line["site_url"]);
+ list ($flavor_image, $flavor_stream, $flavor_kind) = Article::get_article_image($enclosures,
+ $headline_row["content"], $line["site_url"]);
- $headline_row["flavor_image"] = $flavor_image;
- $headline_row["flavor_stream"] = $flavor_stream;
+ $headline_row["flavor_image"] = $flavor_image;
+ $headline_row["flavor_stream"] = $flavor_stream;
- /* optional */
- if ($flavor_kind)
- $headline_row["flavor_kind"] = $flavor_kind;
+ /* optional */
+ if ($flavor_kind)
+ $headline_row["flavor_kind"] = $flavor_kind;
+ }
array_push($headlines, $headline_row);
}