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();

			/**
			 * Fires at the start of the course migration template.
			 *
			 * Use this to inject additional block markup before the default course blocks.
			 *
			 * @since 2.7.1
			 */
			do_action( 'llms_blocks_migrate_course_template_before' );

			?><!-- 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

			/**
			 * Fires at the end of the course migration template.
			 *
			 * Use this to inject additional block markup after the default course blocks.
			 *
			 * @since 2.7.1
			 */
			do_action( 'llms_blocks_migrate_course_template_after' );

			return ob_get_clean();

		}

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

			/**
			 * Fires at the start of the lesson migration template.
			 *
			 * Use this to inject additional block markup before the default lesson blocks.
			 *
			 * @since 2.7.1
			 */
			do_action( 'llms_blocks_migrate_lesson_template_before' );

			?>
			<!-- wp:llms/lesson-progression /-->

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

			/**
			 * Fires at the end of the lesson migration template.
			 *
			 * Use this to inject additional block markup after the default lesson blocks.
			 *
			 * @since 2.7.1
			 */
			do_action( 'llms_blocks_migrate_lesson_template_after' );

			return ob_get_clean();
		}

		if ( 'llms_membership' ) {

			ob_start();

			/**
			 * Fires at the start of the membership migration template.
			 *
			 * Use this to inject additional block markup before the default membership blocks.
			 *
			 * @since 2.7.1
			 */
			do_action( 'llms_blocks_migrate_membership_template_before' );

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

			/**
			 * Fires at the end of the membership migration template.
			 *
			 * Use this to inject additional block markup after the default membership blocks.
			 *
			 * @since 2.7.1
			 */
			do_action( 'llms_blocks_migrate_membership_template_after' );

			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.