LLMS_Payment_Gateway::get_item_link( string $item_key, string $item_value, string $api_mode = 'live' )
Retrieve an HTML link to a customer, subscription, or source URL
Description Description
If no URL provided returns the item value as string.
Parameters Parameters
- $item_key
-
(string) (Required) The key of the item to retrieve a URL for.
- $item_value
-
(string) (Required) The value of the item to retrieve.
- $api_mode
-
(string) (Optional) The current api mode to retrieve the URL for.
Default value: 'live'
Return Return
(string)
Source Source
File: includes/abstracts/abstract.llms.payment.gateway.php
592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 | public function get_item_link( $item_key , $item_value , $api_mode = 'live' ) { switch ( $item_key ) { case 'customer' : $url = $this ->get_customer_url( $item_value , $api_mode ); break ; case 'subscription' : $url = $this ->get_subscription_url( $item_value , $api_mode ); break ; case 'source' : $url = $this ->get_source_url( $item_value , $api_mode ); break ; default : $url = $item_value ; } if ( false === filter_var( $url , FILTER_VALIDATE_URL ) ) { return $item_value ; } return sprintf( '<a href="%1$s" target="_blank">%2$s</a>' , $url , $item_value ); } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.10.0 | Introduced. |