如何禁用WordPress的小部件块编辑器(Widgets Block Editor)?

沃德普拉斯 发布于 3年前 分类:WordPress

WP 5.8 带有一个新系统来管理名为“Widgets Block Editor”的事件。如何禁用这个新系统并恢复 WordPress 的经典小部件编辑器?

2个回复

  • ttt5

    方法一:是否要禁用古腾堡新的小部件块编辑器页面并带回旧的小部件页面?您只需将此行添加到主题的 functions.php 文件中即可:

    // Disables the block editor from managing widgets in the Gutenberg plugin.
    add_filter( 'gutenberg_use_widgets_block_editor', '__return_false', 100 );
    
    // Disables the block editor from managing widgets. renamed from wp_use_widgets_block_editor
    add_filter( 'use_widgets_block_editor', '__return_false' );

    不要忘记保存functions.php 文件。

  • ttt5

    方法二:如果你不想编辑你的主题functions.php文件,安装并激活这个插件,旧的widgets页面会回来:

    https://wordpress.org/plugins/disable-widget-block-editor/

    经过测试可以实现。

    希望这对你有帮助。