Skip to content

Instantly share code, notes, and snippets.

@WordPress-Handbuch
Last active April 5, 2019 05:29
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 WordPress-Handbuch/10a92312e482d70eff00835ac6fce14e to your computer and use it in GitHub Desktop.
Save WordPress-Handbuch/10a92312e482d70eff00835ac6fce14e to your computer and use it in GitHub Desktop.
functions.php extension to include only specific plugins in the automatic updates
function auto_update_specific_plugins ( $update, $item ) {
// List your plugins to be updated here
$plugins = array (
'cookie-notice',
'relevanssi',
'updraftplus',
'and-any-other-plugin-slugs'
);
if ( in_array( $item->slug, $plugins ) ) {
return true;
}
return $update;
}
add_filter( 'auto_update_plugin', 'auto_update_specific_plugins', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment