WordPress 5.0禁用古滕堡编辑器的方法

WordPress 5.0正式版使用了古滕堡编辑器,非常不习惯,没以前的经典编辑器好用。那么怎么回到以前的编辑器呢?我们可以使用Classic Editor经典编辑器做为插件方式,安装Classic Editor插件回到经典编辑器,这个方法最简单。

还有一个方法就是禁用古滕堡编辑器,在你的WordPress主题的functions.php中插入代码禁用。下面总结下WordPress 5.0禁用古滕堡编辑器的方法:

第一步:

1、使用Classic Editor经典编辑器插件

2、WordPress主题中的functions.php加入:

1
add_filter('use_block_editor_for_post_type', '__return_false');

注意:上面二选一即可。

第二步:

WordPress 5.0会在前端默认加载 wp-block-library-css 作为古滕堡的适配:

wp-block-library-css

去掉这段css,在functions.php中加入:

1
wp_deregister_style('wp-block-library');

标签:,

上一篇:

下一篇: