Skip to content

Instantly share code, notes, and snippets.

@lightningspirit
Last active September 12, 2023 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lightningspirit/20f4c0983bab0ce59934832fcb493bd8 to your computer and use it in GitHub Desktop.
Save lightningspirit/20f4c0983bab0ce59934832fcb493bd8 to your computer and use it in GitHub Desktop.
Disable WordPress plugin updates and notifications
<?php
namespace WP_Disable_Plugin_Update_Notifications;
$plugins = [
'elementor/elementor.php',
'elementor-pro/elementor-pro.php',
];
add_filter( 'site_transient_update_plugins', function ( $value ) use ( $plugins ) {
foreach ( $plugins as $plugin ) {
unset( $value->response[ $plugin ] );
}
return $value;
});
add_filter( 'plugin_auto_update_setting_html', function ( $html, $plugin_file ) use ( $plugins ) {
return in_array( $plugin_file, $plugins ) ? "" : $html;
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment