LLMS_Order::get_last_transaction( array|string $status = 'any', array|string $type = 'any' )
Retrieve the last (most recent) transaction processed for the order
Parameters Parameters
- $status
-
(array|string) (Optional) Filter by status (see transaction statuses). By default looks for any status.
Default value: 'any'
- $type
-
(array|string) (Optional) Filter by type [recurring|single|trial]. By default looks for any type.
Default value: 'any'
Return Return
(LLMS_Transaction|false) instance of the LLMS_Transaction or false if none found
Source Source
File: includes/models/model.llms.order.php
*/ public function get_last_transaction( $status = 'any', $type = 'any' ) { $txns = $this->get_transactions( array( 'per_page' => 1, 'status' => $status, 'type' => $type, 'no_found_rows' => true, ) ); if ( $txns['count'] ) { return array_pop( $txns['transactions'] ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |