LLMS_Controller_Certificates::get_text( int $text_type, array $variables = array() )

Returns a translated text of the given type.


Parameters Parameters

$text_type

(int) (Required) One of the LLMS_Abstract_Controller_User*Engagements::TEXT* constants.

$variables

(array) (Optional) variables that are used in sprintf().

Default value: array()


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/controllers/class.llms.controller.certificates.php

	protected function get_text( $text_type, $variables = array() ) {

		switch ( $text_type ) {
			case self::TEXT_SYNC_AWARDED_ENGAGEMENT_INSUFFICIENT_PERMISSIONS:
				return sprintf(
					/* translators: %1$d: awarded certificate ID */
					__( 'Sorry, you are not allowed to edit the awarded certificate #%1$d.', 'lifterlms' ),
					( $variables['engagement_id'] ?? 0 )
				);
			case self::TEXT_SYNC_AWARDED_ENGAGEMENT_INVALID_TEMPLATE:
				return sprintf(
					/* translators: %1$d: awarded certificate ID */
					__( 'Sorry, the awarded certificate #%1$d does not have a valid certificate template.', 'lifterlms' ),
					( $variables['engagement_id'] ?? 0 )
				);
			case self::TEXT_SYNC_AWARDED_ENGAGEMENTS_INSUFFICIENT_PERMISSIONS:
				return __( 'Sorry, you are not allowed to edit awarded certificates.', 'lifterlms' );
			case self::TEXT_SYNC_AWARDED_ENGAGEMENTS_INVALID_NONCE:
				return __( 'Sorry, you are not allowed to sync awarded certificates.', 'lifterlms' );
			case self::TEXT_SYNC_MISSING_AWARDED_ENGAGEMENT_ID:
				return __( 'Sorry, you need to provide a valid awarded certificate ID.', 'lifterlms' );
			case self::TEXT_SYNC_MISSING_ENGAGEMENT_TEMPLATE_ID:
				return __( 'Sorry, you need to provide a valid certificate template ID.', 'lifterlms' );
			default:
				return parent::get_text( $text_type );
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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