Last active
May 4, 2019 06:03
-
-
Save gaupoit/bde267871fe36e4475e5bb01d6fd8a66 to your computer and use it in GitHub Desktop.
Snippet to update WordPress plugins automatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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