LLMS_Quiz_Attempt::l10n( string $key )

Translate attempt related strings


Parameters Parameters

$key

(string) (Required) Key to translate.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/models/model.llms.quiz.attempt.php

	public function l10n( $key ) {

		$tkey = '';

		switch ( $key ) {

			case 'passed': // Deprecated.
			case 'status':
				$statuses = llms_get_quiz_attempt_statuses();
				$status   = $this->get( 'status' );
				$tkey     = ( $status && isset( $statuses[ $status ] ) ) ? $statuses[ $status ] : $tkey;
				break;

		}

		return $tkey;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.2.0 Made sure the status key exists to avoid trying to access to array's undefined index.
3.9.0
3.16.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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