From my understanding of how WordPress updates core and plugins is that every 12 hours it goes out and looks for updates. When does that time get set? 12 hours from initial installation? I ask this because using the plugin auto-update filter add_filter( 'auto_update_plugin' );
you could theoretically only allow plugins to update between certain times but if that certain time does not fall into that 12 hour window then plugins will never be updated.
Thus leaving the question in my title which is How would one go about altering how often WordPress looks for updates or how to specify a specific time when to auto-update?
For those interested, here's the filter I've been messing with, checks to see IF it's Monday - Friday 8am - 5pm:
function maybe_update_plugins(){
date_default_timezone_set('Your Timezone Here');
$localAssoc = localtime(time(), true);
$update = false;
/***
/* tm_wday[0] = Sunday
/* tm_wday[6] = Saturday
***/
if(
$localAssoc['tm_wday'] > 0 && $localAssoc['tm_wday'] < 6 &&
$localAssoc['tm_hour'] > 7 && $localAssoc['tm_hour'] < 17
){
$update = true;
}
return $update;
}
add_filter( 'auto_update_plugin', 'maybe_update_plugins' );
Edit As a neat sidenote, it does look like this filter is run each time a plugin updates, multiple plugin updates, multiple runs of the filter