Код для отключения нового редактора Гутенберг (вставить в файл functions.php):
## Отключает Гутенберг (новый редактор блоков в WordPress).
## ver: 1.2
if( 'disable_gutenberg' ){
remove_theme_support( 'core-block-patterns' ); // WP 5.5
add_filter( 'use_block_editor_for_post_type', '__return_false', 100 );
// отключим подключение базовых css стилей для блоков
// ВАЖНО! когда выйдут виджеты на блоках или что-то еще, эту строку нужно будет комментировать
remove_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' );
// Move the Privacy Policy help notice back under the title field.
add_action( 'admin_init', function(){
remove_action( 'admin_notices', [ 'WP_Privacy_Policy_Content', 'notice' ] );
add_action( 'edit_form_after_title', [ 'WP_Privacy_Policy_Content', 'notice' ] );
} );
}
Код для отключения обновлений в WordPress (вставить в файл functions.php):
// Отключение обновления плагинов WordPress
remove_action( 'load-update-core.php', 'wp_update_plugins' );
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );
wp_clear_scheduled_hook( 'wp_update_plugins' );
// ОТКЛЮЧАЕМ ОБНОВЛЕНИЕ ТЕМЫ
remove_action( 'load-update-core.php', 'wp_update_themes' );
add_filter( 'pre_site_transient_update_themes', '__return_null' );
// ОТКЛЮЧАЕМ АВТО ОБНОВЛЕНИЯ ТЕМЫ
add_filter( 'auto_update_theme', '__return_false' );
// УДАЛИМ ИМЕЮЩИЕСЯ УВЕДОМЛЕНИЯ ИЗ АДМИНКИ ПО ОБНОВЛЕНИЮ ТЕМЫ
add_action('admin_menu','hide_admin_notices');
function hide_admin_notices() {
remove_action( 'admin_notices', 'update_nag', 3 );
}
