Skip to content

Instantly share code, notes, and snippets.

@neilgee
Created February 26, 2017 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save neilgee/86e111f8483a7c1a01888e66d9b70b6b to your computer and use it in GitHub Desktop.
Save neilgee/86e111f8483a7c1a01888e66d9b70b6b to your computer and use it in GitHub Desktop.
Don't Update Some WordPress Plugins
<?php
/*
Plugin Name: Don't Update Some Plugins
Plugin URI: https://wpbeaches.com
Description: This doesn't update some plugins
Author: Neil Gowran
Author URI: https://wpbeaches.com
License: GPL2
*/
add_filter( 'auto_update_plugin', 'do_not_auto_update_specific_plugins', 10, 2 );
// Don't update some plugins
function do_not_auto_update_specific_plugins ( $update, $item ) {
// Array of plugin slugs to never auto-update
$plugins = array (
'akismet',
'duplicator',
);
if ( in_array( $item->slug, $plugins ) ) {
return false; // Never update plugins in this array
} else {
return true; // Else update the rest
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment