Last active
September 8, 2016 10:08
-
-
Save Nikschavan/7d617083a45f54ff574b64e3ffc7e7c7 to your computer and use it in GitHub Desktop.
Automatically update WordPress plugins whenever updates are available
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 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