Created
October 8, 2017 03:37
-
-
Save JeffAspen/b9a3f16d263ee1a0ac8c8860a8b5a528 to your computer and use it in GitHub Desktop.
Prevent WordPress plugins from requesting updates
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
/* | |
* https://ben.lobaugh.net/blog/202432/prevent-wordpress-plugins-from-requesting-updates | |
* Be sure to change [plugin_folder]/[plugin_file].php to the plugin you want to prevent updating. | |
*/ | |
add_filter( 'site_transient_update_plugins', array( 'no_updates_for_you' ) ); | |
function no_updates_for_you( $value ) { | |
$plugin = '[plugin_folder]/[plugin_file].php'; | |
if ( empty( $value ) || empty( $value->response[$plugin] ) ) { | |
return $value; | |
} | |
unset( $value->response[$plugin] ); | |
return $value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment