LLMS_Processor_Certificate_Sync::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_Processor_User_Engagement*Sync::TEXT* constants.

$variables

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

Default value: array()


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/processors/class-llms-processor-certificate-sync.php

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

		$engagement_template_id = $variables['engagement_template_id'] ?? 0;

		switch ( $text_type ) {
			case self::TEXT_SYNC_NOTICE_ALREADY_SCHEDULED:
				return sprintf(
					/* translators: %1$s: opening anchor tag that links to the certificate template, %2$s: certificate template name, #%3$d: certificate template ID, %4$s: closing anchor tag */
					__( 'Awarded certificates sync already scheduled for the template %1$s%2$s (#%3$d)%4$s.', 'lifterlms' ),
					'<a href="' . get_edit_post_link( $engagement_template_id ) . '" target="_blank">',
					get_the_title( $engagement_template_id ),
					$engagement_template_id,
					'</a>'
				);
			case self::TEXT_SYNC_NOTICE_AWARDED_ENGAGEMENTS_COMPLETE:
				return sprintf(
					/* translators: %1$s: opening anchor tag that links to the certificate template, %2$s: certificate template name, %3$d: certificate template ID, %4$s: closing anchor tag */
					__( 'Awarded certificates sync completed for the template %1$s%2$s (#%3$d)%4$s.', 'lifterlms' ),
					'<a href="' . $this->get_edit_post_link( $engagement_template_id ) . '" target="_blank">',
					get_the_title( $engagement_template_id ),
					$engagement_template_id,
					'</a>'
				);
			case self::TEXT_SYNC_NOTICE_NO_AWARDED_ENGAGEMENTS:
				return sprintf(
					/* translators: %1$s: opening anchor tag that links to the certificate template, %2$s: certificate template name, #%3$d: certificate template ID, %4$s: closing anchor tag */
					__( 'There are no awarded certificates to sync with the template %1$s%2$s (#%3$d)%4$s.', 'lifterlms' ),
					'<a href="' . get_edit_post_link( $engagement_template_id ) . '" target="_blank">',
					get_the_title( $engagement_template_id ),
					$engagement_template_id,
					'</a>'
				);
			case self::TEXT_SYNC_NOTICE_SCHEDULED:
				return sprintf(
					/* translators: %1$s: opening anchor tag that links to the certificate template, %2$s: certificate template name, #%3$d: certificate template ID, %4$s: closing anchor tag */
					__( 'Awarded certificates sync scheduled for the template %1$s%2$s (#%3$d)%4$s.', 'lifterlms' ),
					'<a href="' . get_edit_post_link( $engagement_template_id ) . '" target="_blank">',
					get_the_title( $engagement_template_id ),
					$engagement_template_id,
					'</a>'
				);
			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.