Skip to content

Instantly share code, notes, and snippets.

@Hansanghyeon
Created October 27, 2021 00:12
Show Gist options
  • Save Hansanghyeon/9a8a6d90fe3cb8587a86045cf28e490f to your computer and use it in GitHub Desktop.
Save Hansanghyeon/9a8a6d90fe3cb8587a86045cf28e490f to your computer and use it in GitHub Desktop.
<?php
/**
* Prevent update notification for plugin -
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Add to the core plugin file
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
$plugin_file_name = basename(__DIR__) . '/' . basename(__FILE__);
if ( isset( $value->response[$plugin_file_name] ) ) {
unset( $value->response[$plugin_file_name] );
}
}
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