Skip to content

Instantly share code, notes, and snippets.

@gaupoit
Last active May 4, 2019 06:03
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 gaupoit/bde267871fe36e4475e5bb01d6fd8a66 to your computer and use it in GitHub Desktop.
Save gaupoit/bde267871fe36e4475e5bb01d6fd8a66 to your computer and use it in GitHub Desktop.
Snippet to update WordPress plugins automatically
<?php
function pda_auto_update_specific_plugins ( $update, $item ) {
$plugins = array (
'wp-pda-ip-block',
'pda-membership-integration',
);
if ( in_array( $item->slug, $plugins ) ) {
return true; // We can add more control logic here, for example only update in the specific version
} else {
return $update;
}
}
add_filter( 'auto_update_plugin', 'pda_auto_update_specific_plugins', 10, 2 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment