Skip to content

Instantly share code, notes, and snippets.

@shameemreza
Created October 30, 2022 11:27
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 shameemreza/d590fc44f2d8cd82b7a4af0fa58b4981 to your computer and use it in GitHub Desktop.
Save shameemreza/d590fc44f2d8cd82b7a4af0fa58b4981 to your computer and use it in GitHub Desktop.
/**
* Prevent update notification for plugin
* https://orixlab.net/disable-updates-for-specific-plugin-in-wordpress
* Place at bottom in theme functions.php
*/
function 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', 'disable_plugin_updates' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment