您可以在保存之前使用call kses\\u remove\\u filters(),然后再调用kses\\u init\\u filters(),但请注意,它也会从标题、摘录和注释中删除筛选,因此您应该做的只是取消设置内容筛选器。
// Post filtering
remove_filter(\'content_save_pre\', \'wp_filter_post_kses\');
remove_filter(\'content_filtered_save_pre\', \'wp_filter_post_kses\');
保存帖子后
// Post filtering
add_filter(\'content_save_pre\', \'wp_filter_post_kses\');
add_filter(\'content_filtered_save_pre\', \'wp_filter_post_kses\');