LLMS_Form_Field::get_html()
Retrieve the field’s HTML.
Return Return
(string)
Source Source
File: includes/forms/class-llms-form-field.php
public function get_html() {
/**
* Short-circuit field HTML generation.
*
* Allows a 3rd party to replace the HTML generation method with entirely custom HTML
* by returning a non-null value.
*
* @since 5.0.0
*
* @param string $pre The pre-rendered HTML content. Default `null`.
* @param array $settings The prepared field settings array.
* @param LLMS_Form_Field $field_obj Form field instance.
*/
$pre = apply_filters( 'llms_form_field_pre_render', null, $this->settings, $this );
if ( ! is_null( $pre ) ) {
return $pre;
}
$before = '';
$after = '';
if ( 'hidden' !== $this->settings['type'] ) {
$before .= sprintf( '<div class="%s">', implode( ' ', $this->settings['wrapper_classes'] ) );
$label_pos = $this->get_label_position();
$$label_pos .= $this->get_label_html();
$desc = $this->get_description_html();
if ( $this->is_input_group() ) {
$before .= $desc;
} else {
$after .= $this->get_description_html();
}
$after .= '</div>';
if ( $this->settings['last_column'] ) {
$after .= '<div class="clear"></div>';
}
}
$this->html = $before . $this->get_field_html() . $after;
return apply_filters( 'llms_form_field', $this->html, $this->settings );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.0.0 | Introduced. |