果林さんと愛さん、大人っぽい店に行き、愛「ご飯の後もカリンと遊びたい」【毎日劇場0501】

まとめ記事
宮下愛
朝香果林
毎日劇場
1: 2020/05/01(金) 00:04:50.84 ID:k1FzZpbx ほう…
0

【ラブライブ!】【画像】半回転捻りギャラクシーすき【Liella!】

ネタ・雑談
アニメーLiella!
すこし前の記事・話題
平安名すみれ
雑談ースーパースター!!
1:名無しで叶える物語(もんじゃ) 2021/09/20(月) 15:48:05.40 ID:heoEeaAr
0
   

タイトルとURLをコピーしました
/** * Reddit RSS取得・サーバー側完結版 */ add_shortcode('red', function($atts) { global $post; $url = isset($atts['url']) ? $atts['url'] : ''; if (empty($url)) return ''; // キャッシュ名を作成(12時間保存) $cache_key = 'rd_cache_' . md5($url); $display_text = get_transient($cache_key); if ($display_text === false) { $display_text = ''; $rss_url = rtrim($url, '/') . '/.rss'; include_once(ABSPATH . WPINC . '/feed.php'); $rss = fetch_feed($rss_url); if (!is_wp_error($rss)) { $url_parts = explode('/', rtrim($url, '/')); $comment_id = end($url_parts); // o2hi14v $items = $rss->get_items(0, 10); foreach ($items as $item) { // IDが一致するコメント本文を探す if (strpos($item->get_id(), $comment_id) !== false) { $display_text = $item->get_content(); break; } } // 見つからなければ最初のアイテム if (empty($display_text) && isset($items[0])) { $display_text = $items[0]->get_content(); } } if (!empty($display_text)) { // HTMLの掃除 $display_text = html_entity_decode($display_text); $display_text = preg_replace('/\[link\].*$/us', '', $display_text); // 余計な末尾リンクをカット $display_text = strip_tags($display_text); $display_text = trim($display_text); } // 取得失敗時やIDのみの場合は空にする(表示させない) if (empty($display_text) || strlen($display_text) < 5) { $display_text = 'Check original Reddit post for details.'; } set_transient($cache_key, $display_text, 12 * HOUR_IN_SECONDS); } wp_enqueue_script('reddit-widgets', 'https://embed.reddit.com/widgets.js', array(), null, true); // 出力(最初から本文が入った状態) $out = '
'; $out .= '
'; $out .= '
'; $out .= '

【原文・翻訳】

'; $out .= '
' . esc_html($display_text) . '
'; $out .= '
'; return $out; });