User Post Type – force a sync every 8 hours

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

add_action( ‘mysite_sync_users’, [ UPT()->sync, ‘run_sync’ ] );

if ( ! wp_next_scheduled( ‘mysite_sync_users’ ) ) {
wp_schedule_single_event( time() + 28800, ‘mysite_sync_users’ ); // every 8 hours
}

{{/gist}}