Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Blocks_Migrate::get_template( string $post_type, boolean $merge_deprecated_versions = false )

Retrieve the block template by post type.


Parameters Parameters

$post_type

(string) (Required) WP post type.

$merge_deprecated_versions

(boolean) (Optional) Whether or not getting the deprecated blocks merged, useful when removing templates. Default false.

Default value: false


Top ↑

Return Return

(string)


Top ↑

Source Source

File: libraries/lifterlms-blocks/includes/class-llms-blocks-migrate.php

	private function get_template( $post_type, $merge_deprecated_versions = false ) {

		if ( 'course' === $post_type ) {
			ob_start();

			?><!-- wp:llms/course-information /-->

<!-- wp:llms/instructors /-->

<!-- wp:llms/pricing-table /-->

<!-- wp:llms/course-progress /-->
			<?php if ( $merge_deprecated_versions ) : ?>

<!-- wp:llms/course-progress -->
<div class="wp-block-llms-course-progress">[lifterlms_course_progress check_enrollment=1]</div>
<div class="wp-block-llms-course-progress">[lifterlms_course_progress]</div>
<!-- /wp:llms/course-progress -->
			<?php endif; ?>

<!-- wp:llms/course-continue-button -->
<div class="wp-block-llms-course-continue-button" style="text-align:center">[lifterlms_course_continue_button]</div>
<!-- /wp:llms/course-continue-button -->

<!-- wp:llms/course-syllabus /-->
			<?php

			return ob_get_clean();

		}

		if ( 'lesson' === $post_type ) {
			ob_start();
			?>
			<!-- wp:llms/lesson-progression /-->

<!-- wp:llms/lesson-navigation /-->
			<?php

			return ob_get_clean();
		}

		if ( 'llms_membership' ) {

			ob_start();
			?>
			<!-- wp:llms/pricing-table /-->
			<?php
			return ob_get_clean();

		}

		return '';

	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.9.1 Fix course progress block.
1.8.0 Updated course progress shortcode and added the $merge_deprecated_versions param.
1.7.0 Add membership template.
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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