Skip to content

Instantly share code, notes, and snippets.

@Nikschavan
Last active September 8, 2016 10:08
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 Nikschavan/7d617083a45f54ff574b64e3ffc7e7c7 to your computer and use it in GitHub Desktop.
Save Nikschavan/7d617083a45f54ff574b64e3ffc7e7c7 to your computer and use it in GitHub Desktop.
Automatically update WordPress plugins whenever updates are available
<?php
function auto_update_specific_plugins ( $update, $item ) {
// Array of plugin slugs to always auto-update
$plugins = array (
'bb-ultimate-addon',
);
if ( in_array( $item->slug, $plugins ) ) {
return true; // Always update plugins in this array
} else {
return $update; // Else, use the normal API response to decide whether to update or not
}
}
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