Skip to content

Commit

Permalink
Merge pull request #1155 from crstauf/phpcs/ActionScheduler_DBStoreMi…
Browse files Browse the repository at this point in the history
…grator.php

PHPCS: `classes/migration/ActionScheduler_DBStoreMigrator.php`
  • Loading branch information
barryhughes authored Oct 29, 2024
2 parents a01c49a + 601fe25 commit 60b195d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions classes/migration/ActionScheduler_DBStoreMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,22 @@ class ActionScheduler_DBStoreMigrator extends ActionScheduler_DBStore {
* @return string The action ID
* @throws \RuntimeException When the action is not saved.
*/
public function save_action( ActionScheduler_Action $action, \DateTime $scheduled_date = null, \DateTime $last_attempt_date = null ){
public function save_action( ActionScheduler_Action $action, \DateTime $scheduled_date = null, \DateTime $last_attempt_date = null ) {
try {
/** @var \wpdb $wpdb */
/**
* Global.
*
* @var \wpdb $wpdb
*/
global $wpdb;

$action_id = parent::save_action( $action, $scheduled_date );

if ( null !== $last_attempt_date ) {
$data = [
$data = array(
'last_attempt_gmt' => $this->get_scheduled_date_string( $action, $last_attempt_date ),
'last_attempt_local' => $this->get_scheduled_date_string_local( $action, $last_attempt_date ),
];
);

$wpdb->update( $wpdb->actionscheduler_actions, $data, array( 'action_id' => $action_id ), array( '%s', '%s' ), array( '%d' ) );
}
Expand Down

0 comments on commit 60b195d

Please sign in to comment.