LLMS_User_Certificate::get_template_version()

Retrieves the certificate’s template version.


Description Description

Since LifterLMS 6.0.0, certificates are created using the block editor.

Certificates created in the classic editor will use template version 1 while any certificates created in the block editor use template version 2. Therefore a certificate that has content and no blocks will use template version 1 and any empty certificates or those containing blocks will use template version 2.


Top ↑

Return Return

(integer)


Top ↑

Source Source

File: includes/models/model.llms.user.certificate.php

	public function get_template_version() {

		$version = empty( $this->get( 'content', true ) ) || has_blocks( $this->get( 'id' ) ) ? 2 : 1;

		/**
		 * Filters a certificate's template version.
		 *
		 * @since 6.0.0
		 *
		 * @param int $version The template version.
		 */
		return apply_filters( 'llms_certificate_template_version', $version, $this );

	}


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.