Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Simple runNow() function for wp-cron-pixie
runNow: function() {
// Only bother to run update if not due before next refresh.
var seconds_due = this.model.get( 'seconds_due' );
if ( seconds_due > CronPixie.timer_period ) {
var timestamp = this.model.get( 'timestamp' ) - seconds_due;
this.model.save(
{ timestamp: timestamp, seconds_due: 0 }
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment