LLMS_Form_Templates::get_template( string $location )

Retrieve the block template HTML for a given location.


Parameters Parameters

$location

(string) (Required) Form location. Accepts "checkout", "registration", or "account".


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/forms/class-llms-form-templates.php

	public static function get_template( $location ) {

		/**
		 * Filters whether or not reusable blocks should be used when generating a form template
		 *
		 * By default when migrating from 4.x, non-reusable blocks will be used in order to ensure legacy settings
		 * are transferred during an upgrade to 5.x. However, on a "clean" install of 5.x, reusable blocks will be
		 * used in favor of regular blocks.
		 *
		 * @since 5.0.0
		 *
		 * @param boolean $use_reusable Whether or not to use reusable blocks.
		 */
		$use_reusable = apply_filters( 'llms_blocks_template_use_reusable_blocks', ( 'not-set' === get_option( 'lifterlms_registration_generate_username', 'not-set' ) ) );

		$blocks = self::get_template_blocks( $location, $use_reusable );

		return serialize_blocks( $blocks );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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