-
-
Save Kenshino/729d1757e55544ff4ab6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/* | |
* Plugin Auto Updates Whitelist | |
* Allows Forced Updates for listed Plugin Slugs | |
*/ | |
function pb_auto_update_whitelist_plugins( $update, $item ) { | |
// Array of plugin slugs to whitelist | |
$plugins = array ( | |
'jetpack', | |
'wordpress-seo', | |
'plugin-slug', | |
); | |
if ( in_array( $item->slug, $plugins ) ) { | |
// Allow listed to be force updated | |
return $update; | |
} else { | |
// Block all others | |
return false; | |
} | |
} | |
add_filter( 'auto_update_plugin', 'pb_auto_update_whitelist_plugins', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment