llms_form_field( array $field = array(), boolean $echo = true, int|object $data_source = null )

Generate the HTML for a form field


Description Description

This function is used during AJAX calls so needs to be in a core file loaded during AJAX calls!


Top ↑

Parameters Parameters

$field

(array) (Optional) Field settings.

Default value: array()

$echo

(boolean) (Optional) Whether or not to output (echo) the field HTML. Default is true.

Default value: true

$data_source

(int|object) (Optional) Data source where to get field value from. Default is null.

Default value: null


Top ↑

Return Return

(string)


Top ↑

Source Source

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

function llms_form_field( $field = array(), $echo = true, $data_source = null ) {

	$args = array( $field );
	if ( ! is_null( $data_source ) ) {
		$args[] = $data_source;
	}

	$field = new LLMS_Form_Field( ...$args );

	if ( $echo ) {
		$field->render();
	}

	return $field->get_html();

}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Move from file: llms.functions.core.php. Utilize LLMS_Form_Field class for field generation and output.
3.19.4 Unknown.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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