mizner
9/2/2017 - 7:15 PM

WP Auto Update

WP Auto Update

<?php 
// Keep Core Updated
add_filter( 'auto_update_core', '__return_true' );

// Plugins to keep updated
function auto_update_specific_plugins ( $update, $item ) {
    // Array of plugin slugs to always auto-update
    $plugins = array (
        'akismet',
        'jetpack',
        'postmark-approved-wordpress-plugin',
        'woocommerce',
        'wordpress-seo',
        'gravityforms',
        'wpclef'
    );
    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 );