Last active
September 12, 2023 16:34
-
-
Save lightningspirit/20f4c0983bab0ce59934832fcb493bd8 to your computer and use it in GitHub Desktop.
Disable WordPress plugin updates and notifications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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