jawittdesigns
2/25/2017 - 6:59 PM

Disable WordPress updates

Disable WordPress updates

//Disable all automatic updates from wp-core, themes, plugins
$this->addFilter('auto_update_translation', '__return_false');
$this->addFilter('automatic_updater_disabled', '__return_true');
$this->addFilter('allow_minor_auto_core_updates', '__return_false');
$this->addFilter('allow_major_auto_core_updates', '__return_false');
$this->addFilter('allow_dev_auto_core_updates', '__return_false');
$this->addFilter('auto_update_core', '__return_false');
$this->addFilter('wp_auto_update_core', '__return_false');
$this->addFilter('auto_core_update_send_email', '__return_false');
$this->addFilter('send_core_update_notification_email', '__return_false');
$this->addFilter('auto_update_plugin', '__return_false');
$this->addFilter('auto_update_theme', '__return_false');
$this->addFilter('automatic_updates_send_debug_email', '__return_false');
$this->addFilter('automatic_updates_is_vcs_checkout', '__return_true');
$this->addFilter('pre_http_request', array($this, 'blockRequest'), array(
	'num_args' => 3
));
remove_action('admin_notices', 'update_nag', 3);
remove_action('network_admin_notices', 'update_nag', 3);
remove_action('admin_notices', 'maintenance_nag');
remove_action('network_admin_notices', 'maintenance_nag');
remove_action('wp_maybe_auto_update', 'wp_maybe_auto_update');
remove_action('admin_init', 'wp_maybe_auto_update');
remove_action('admin_init', 'wp_auto_update_core');
wp_clear_scheduled_hook('wp_maybe_auto_update');

remove_action( 'wp_version_check', 'wp_version_check');
remove_action( 'admin_init', '_maybe_update_core');
$this->addFilter('pre_transient_update_core', '__return_zero');
$this->addFilter('pre_site_transient_update_core', '__return_zero');

// Plugins
remove_action('load-plugins.php', 'wp_update_plugins');
remove_action('load-update.php', 'wp_update_plugins');
remove_action('admin_init', '_maybe_update_plugins');
remove_action('wp_update_plugins', 'wp_update_plugins');
remove_action('load-update-core.php', 'wp_update_plugins');
$this->addFilter('pre_transient_update_plugins', '__return_zero');
$this->addFilter('pre_site_transient_update_plugins', '__return_zero');