Skip to content

Instantly share code, notes, and snippets.

@danielbitzer
Last active September 14, 2022 11:13
Show Gist options
  • Save danielbitzer/1c4857b2d49fc28a66003dc2f08154d4 to your computer and use it in GitHub Desktop.
Save danielbitzer/1c4857b2d49fc28a66003dc2f08154d4 to your computer and use it in GitHub Desktop.
[AutomateWoo] Update a queued workflow run date programatically
<?php
// Requires AW 4.3
// create date object
$date = new AutomateWoo\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