Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.