Written by Anonymous
// コード1 'amp-tiktok' => 'amp-tiktok-0.1.js', // コード2 // TikTokをamp-tiktokに置換する $pattern = '{<blockquote class="tiktok-embed"[^>]+?"https://www.tiktok.com/[^/]+?/video/([^"]+?)".+?</blockquote>}is'; $append = '<amp-tiktok width="325" height="575" data-src="$1"></amp-tiktok>'; $the_content = preg_replace($pattern, $append, $the_content); $pattern = '{<script async src="https://www.tiktok.com/embed.js"></script>}is'; $the_content = preg_replace($pattern, '', $the_content); // コード3 //amp-imgが含まれるCSSセレクタは除外しない if (strpos($comma_splited_selector, 'amp-img') !== false) { return true; } // コード4 //amp-およびi-amphtmlが含まれるCSSセレクタは除外しない if (strpos($comma_splited_selector, 'amp-') !== false) { return true; } if (strpos($comma_splited_selector, 'i-amphtml') !== false) { return true; } // コード5 'amp-pinterest' => 'amp-pinterest-0.1.js', // コード6 $pattern = '{<a data-pin-do="embedPin" .+?href="([^"]+?)".+?</a>}is'; $append = '<amp-pinterest width="245" height="330" data-do="embedPin" data-url="$1"></amp-pinterest>'; $the_content = preg_replace($pattern, $append, $the_content);