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.


Top ↑

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'


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/abstracts/abstract.llms.payment.gateway.php

	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 );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.10.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.