Last active
September 14, 2022 11:13
-
-
Save danielbitzer/1c4857b2d49fc28a66003dc2f08154d4 to your computer and use it in GitHub Desktop.
[AutomateWoo] Update a queued workflow run date programatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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