LLMS_Order_Generator::validate_order()
Validates the order.
Description Description
Ensures the submitted order key is valid and that the order can be confirmed.
Return Return
(boolean|WP_Error) Returns true
on success or an error object.
Source Source
File: includes/class-llms-order-generator.php
protected function validate_order() { $order_id = $this->get_order_id(); if ( 'new' === $order_id || 'llms_order' !== get_post_type( $order_id ) ) { return $this->error( self::E_ORDER_NOT_FOUND, __( 'Could not locate an order to confirm.', 'lifterlms' ) ); } $order = llms_get_post( $order_id ); if ( ! $order->can_be_confirmed() ) { return $this->error( self::E_ORDER_NOT_CONFIRMABLE, __( 'Could not locate an order to confirm.', 'lifterlms' ) ); } $this->order = $order; return true; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
7.0.0 | Introduced. |