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

488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
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.