Skip to content

Instantly share code, notes, and snippets.

@nfsarmento
Created April 17, 2024 19:13
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 nfsarmento/efa18dc5aefc92787ea27912141cdb1f to your computer and use it in GitHub Desktop.
Save nfsarmento/efa18dc5aefc92787ea27912141cdb1f to your computer and use it in GitHub Desktop.
WordPress - Disable a specific plugin update check
<?php
/**
*
* Prevent update notification for plugin
*
*/
function ns_disable_plugin_updates( $value ) {
$pluginsToDisable = [
'plugin-folder/plugin.php',
'plugin-folder2/plugin2.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', 'ns_disable_plugin_updates' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment