ActionScheduler_wpPostStore::log_execution
Log Execution.
Method of the class: ActionScheduler_wpPostStore{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ActionScheduler_wpPostStore = new ActionScheduler_wpPostStore(); $ActionScheduler_wpPostStore->log_execution( $action_id );
- $action_id(string) (required)
- Action ID.
ActionScheduler_wpPostStore::log_execution() ActionScheduler wpPostStore::log execution code WC 10.8.1
public function log_execution( $action_id ) {
/**
* Global wpdb object.
*
* @var wpdb $wpdb
*/
global $wpdb;
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
$status_updated = $wpdb->query(
$wpdb->prepare(
"UPDATE {$wpdb->posts} SET menu_order = menu_order+1, post_status=%s, post_modified_gmt = %s, post_modified = %s WHERE ID = %d AND post_type = %s",
self::STATUS_RUNNING,
current_time( 'mysql', true ),
current_time( 'mysql' ),
$action_id,
self::POST_TYPE
)
);
if ( ! $status_updated ) {
throw new Exception(
sprintf(
/* translators: 1: action ID. 2: status slug. */
__( 'Unable to update the status of action %1$d to %2$s.', 'woocommerce' ),
$action_id,
self::STATUS_RUNNING
)
);
}
}