Skip to content

Instantly share code, notes, and snippets.

@rcstr
Forked from danielbitzer/functions.php
Last active August 2, 2018 13:37
Show Gist options
  • Save rcstr/ca7ff4674a00edf5445e68876d46e1f2 to your computer and use it in GitHub Desktop.
Save rcstr/ca7ff4674a00edf5445e68876d46e1f2 to your computer and use it in GitHub Desktop.
[AutomateWoo] Update a queued workflow run date programatically
<?php
// create date object
$date = new DateTime( '2018-07-23 06:12:04' );
// get the queued event by ID
$event = \AutomateWoo\Queued_Event_Factory::get( $event_id );
$event->set_date_due( $date );
$event->save();
// alternatively you can get the event via a query
$query = new AutomateWoo\Queue_Query();
$query->where_order( 1234 );
foreach ( $query->get_results() as $event ) {
$event->set_date_due( $date );
$event->save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment