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

Retrieve an array of LLMS_Form_Fields settings arrays for the form at a given location.


Description Description

This method is used by the LLMS_Form_Handler to perform validations on user-submitted data.


Top ↑

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

(false|array)


Top ↑

Source Source

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

	public function get_form_fields( $location, $args = array() ) {

		$blocks = $this->get_form_blocks( $location, $args );

		if ( false === $blocks ) {
			return false;
		}

		$fields = $this->get_fields_settings_from_blocks( $blocks );

		/**
		 * Modify the parsed array of LifterLMS Form Fields
		 *
		 * @since 5.0.0
		 *
		 * @param array[] $fields   Array of LifterLMS Form Field settings data.
		 * @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_fields', $fields, $location, $args );

	}


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.