Last active
August 15, 2018 10:55
-
-
Save fencermonir/ca0b2973400624ea039a25f91faa0e37 to your computer and use it in GitHub Desktop.
Disable Wordpress Plugin Update Notification
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
// disable update notice for plugins | |
function disable_plugin_updates( $value ) { | |
$pluginsToDisable = [ | |
'plugin-folder-name-1/main-file-name-1.php', | |
'plugin-folder-name-2/main-file-name-2.php', | |
]; | |
if ( isset($value) && is_object($value) ) { | |
foreach ($pluginsToDisable as $plugin) { | |
if ( isset( $value->response[$plugin] ) ) { | |
unset( $value->response[$plugin] ); | |
} | |
} | |
} | |
return $value; | |
} | |
add_filter( 'site_transient_update_plugins', 'disable_plugin_updates' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment