Skip to content

Instantly share code, notes, and snippets.

@anonymousraft
Created December 16, 2019 03:41
Show Gist options
  • Select an option

  • Save anonymousraft/ead5401a26d3a702ac4f91ad09eb8829 to your computer and use it in GitHub Desktop.

Select an option

Save anonymousraft/ead5401a26d3a702ac4f91ad09eb8829 to your computer and use it in GitHub Desktop.
updating specific plugin in wordpress
function auto_update_specific_plugins ( $update, $item ) {
// Array of plugin slugs to always auto-update
$plugins = array (
'akismet',
'buddypress',
);
if ( in_array( $item->slug, $plugins ) ) {
// Always update plugins in this array
return true;
} else {
// Else, use the normal API response to decide whether to update or not
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