ActionScheduler_wpPostStore::mark_failure()publicWC 1.0

Mark failure on action.

{} Это метод класса: ActionScheduler_wpPostStore{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$ActionScheduler_wpPostStore = new ActionScheduler_wpPostStore();
$ActionScheduler_wpPostStore->mark_failure( $action_id );
$action_id(int) (обязательный)
Action ID.

Код ActionScheduler_wpPostStore::mark_failure() WC 6.9.4

public function mark_failure( $action_id ) {
	/**
	 * Global wpdb object.
	 *
	 * @var wpdb $wpdb
	 */
	global $wpdb;

	// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
	$result = $wpdb->query(
		$wpdb->prepare( "UPDATE {$wpdb->posts} SET post_status = %s WHERE ID = %d AND post_type = %s", self::STATUS_FAILED, $action_id, self::POST_TYPE )
	);
	if ( false === $result ) {
		/* translators: %s: action ID */
		throw new RuntimeException( sprintf( __( 'Unable to mark failure on action %s. Database error.', 'woocommerce' ), $action_id ) );
	}
}