Allows overriding of the full sync cron schedule which defaults to once every 5 minutes.
Parameters
- self::DEFAULT_SYNC_CRON_INTERVAL_NAME
string
Changelog
- Introduced in Jetpack 1.6.3
How to use this hook
Notes
You can use this filter to change the interval at which sync events happen on your site. Instead of 5 minutes, we could for example have them run every 10 minutes like so:
function jetpackcom_custom_sync_schedule( $schedules ) {
if ( ! isset( $schedules['10min'] ) ) {
$schedules['10min'] = array(
'interval' => 10 * MINUTE_IN_SECONDS,
'display' => __( 'Every 10 minutes' ),
);
}
return $schedules;
}
add_filter( 'cron_schedules', 'jetpackcom_custom_sync_schedule' );
function jetpackcom_return_10_min() {
return '10min';
}
add_filter( 'jetpack_sync_incremental_sync_interval', 'jetpackcom_return_10_min' );
add_filter( 'jetpack_sync_full_sync_interval', 'jetpackcom_return_10_min' );