LLMS_Order::get_switch_source_action()
Retrieves the user action required when changing the order’s payment source.
Return Return
(null|string) Returns switch
when the payment source can be switched and pay
when payment on the new source is required before switching. A null
return indicates that the order's payment source cannot be switched.
Source Source
File: includes/models/model.llms.order.php
public function get_switch_source_action() { $action = null; if ( $this->can_switch_source() ) { $action = in_array( $this->get( 'status' ), array( 'llms-active', 'llms-pending-cancel' ), true ) ? 'switch' : 'pay'; } /** * Filters the required user action for the order when switching the order's payment source. * * @since 7.0.0 * * @param null|string $action The switch action ID or `null` when the payment source cannot be switched. * @param LLMS_Order $order The order object. */ return apply_filters( 'llms_order_switch_source_action', $action, $this ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
7.0.0 | Introduced. |