LLMS_Forms::get_form_html( string $location, array $args = array() )

Retrieve the rendered HTML for the form at a given location.


Parameters Parameters

$location

(string) (Required) Form location, one of: "checkout", "registration", or "account".

$args

(array) (Optional) Additional arguments passed to the short-circuit filter in get_form_post().

Default value: array()


Top ↑

Return Return

(string)


Top ↑

Source Source

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

		$html = '';
		foreach ( $blocks as $block ) {
			$html .= render_block( $block );
		}

		if ( $disable_visibility ) {
			remove_filter( 'llms_blocks_visibility_should_filter_block', '__return_false', 999 );
		}

		/**
		 * Modify the parsed array of LifterLMS Form Fields.
		 *
		 * @since 5.0.0
		 *
		 * @param string $html     Form fields HTML.
		 * @param string $location Form location, one of: "checkout", "registration", or "account".
		 * @param array  $args     Additional arguments passed to the short-circuit filter in `get_form_post()`.
		 */
		return apply_filters( 'llms_get_form_html', $html, $location, $args );
	}

	/**
	 * Retrieve the WP Post for the form at a given location.
	 *
	 * @since 5.0.0
	 *
	 * @param string $location Form location, one of: "checkout", "registration", or "account".
	 * @param array  $args     Additional arguments passed to the short-circuit filter.
	 * @return WP_Post|false
	 */
	public function get_form_post( $location, $args = array() ) {

		// @todo Add caching. This runs twice on some page loads.

		/**

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.