-
-
Save rcstr/ca7ff4674a00edf5445e68876d46e1f2 to your computer and use it in GitHub Desktop.
[AutomateWoo] Update a queued workflow run date programatically
This file contains hidden or 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 | |
// 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