/
phprus
/
git.tt-rss.org_fox_ttrss-api-content-lang
Обзор
Документация
Войти
/
phprus
/
git.tt-rss.org_fox_ttrss-api-content-lang
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
init.php
28 строк
570 B
Andrew Dolgov
initial
07 май 2019, 08:09
07 май 2019, 08:09
e0ef3cc
Код
Авторство
О чём код?
<?php class Api_Content_Lang extends Plugin { private $host; function about() { return array(1.0, "Sets lang=zh to article content returned via API (Chrome issue workaround)", "fox"); } function init($host) { $this->host = $host; $host->add_hook($host::HOOK_RENDER_ARTICLE_API, $this); } function hook_render_article_api($row) { $article = isset($row['headline']) ? $row['headline'] : $row['article']; $article['content'] = "<div lang='zh'>" . $article['content'] . "</div>"; return $article; } function api_version() { return 2; } }