企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` function git_esc_html($content) { $regex = '/(<pre\s+[^>]*?class\s*?=\s*?[",\'].*?prettyprint.*?[",\'].*?>)(.*?)(<\/pre>)/sim'; return preg_replace_callback($regex, 'git_esc_callback', $content); } function git_esc_callback($matches) { $tag_open = $matches[1]; $content = $matches[2]; $tag_close = $matches[3]; $content = esc_html($content); return $tag_open . $content . $tag_close; } add_filter('the_content', 'git_esc_html', 2); add_filter('comment_text', 'git_esc_html', 2); ```