LLMS_Transaction::translate( string $key )

Translation wrapper for {@see LLMS_Transaction::get()` which enables l10n of database values.


Parameters Parameters

$key

(string) (Required) Key to retrieve.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/models/model.llms.transaction.php

	public function translate( $key ) {

		$val = $this->get( $key );

		switch ( $key ) {

			case 'payment_type':
				if ( 'single' === $val ) {
					$val = __( 'Single', 'lifterlms' );
				} elseif ( 'recurring' === $val ) {
					$val = __( 'Recurring', 'lifterlms' );
				} elseif ( 'trial' === $val ) {
					$val = __( 'Trial', 'lifterlms' );
				}
				break;

			default:
				$val = $val;
		}

		return $val;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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