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!
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
Return Return
(string)
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(); }
Expand full source code Collapse full source code View on GitHub
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. |