Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Created November 15, 2019 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/2844b4b4a2967fa2f97c3c3563ba9cf4 to your computer and use it in GitHub Desktop.
Save mgibbs189/2844b4b4a2967fa2f97c3c3563ba9cf4 to your computer and use it in GitHub Desktop.
User Post Type - force a sync every 8 hours
<?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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment