LLMS_Form_Field::get_label_html()

Retrieve the HTML for the fields label.


Return Return

(string)


Top ↑

Source Source

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

	protected function get_label_html() {

		if ( empty( $this->settings['label'] ) && ! $this->settings['label_show_empty'] ) {
			return '';
		}

		$required = '';
		if ( $this->settings['required'] ) {

			/**
			 * Customize the character used to denote a required field
			 *
			 * @since Unknown.
			 *
			 * @param string $character The character used to denote a required field. Defaults to "*" (an asterisk).
			 * @param array  $settings  Associative array of field settings.
			 */
			$char     = apply_filters( 'lifterlms_form_field_required_character', '*', $this->settings );
			$required = sprintf( '<span class="llms-required">%s</span>', $char );

		}

		return sprintf( '<label for="%1$s">%2$s%3$s</label>', esc_attr( $this->settings['id'] ), $this->settings['label'], $required );

	}


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.