我只想删除[gallery]
我博客文章中的简码。我找到的唯一解决方案是添加到我的函数中的过滤器。
function remove_gallery($content) {
if ( is_single() ) {
$content = strip_shortcodes( $content );
}
return $content;
}
add_filter('the_content', 'remove_gallery');
它删除了所有简码,包括[caption]
我需要的图像。如何指定要排除或包含的单个短代码?