Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How is this differnt from the GEM_Form_Fields::text_field method? #50

Open
jrtashjian opened this issue May 19, 2020 · 0 comments
Open

Comments

@jrtashjian
Copy link
Member

Migrating TODO from inline comment.

/**
* Displays the string field.
*
* @todo How is this differnt from the GEM_Form_Fields::text_field method?
*
* @param array $args Settings field arguments.
*/
public static function string( $args ) {
$field_classes = array( 'gem-field' );
// Is this field required?
if ( $args->required ) {
$field_classes[] = 'gem-required';
}
$field_classes = (array) apply_filters( 'gem_required_field_class', $field_classes, $args );
?>
<label for="<?php echo esc_attr( self::get_form_id( $args->name ) ); ?>">
<?php echo esc_html( $args->display ); ?>
<?php if ( $args->required && apply_filters( 'gem_required_field_indicator', true, $args ) ) : ?>
<span class="required">*</span>
<?php endif; ?>
</label>
<br/>
<input type="text" name="<?php echo esc_attr( $args->name ); ?>" id="<?php echo esc_attr( self::get_form_id( $args->name ) ); ?>" class="<?php echo esc_attr( join( ' ', $field_classes ) ); ?>" data-label="<?php echo esc_attr( $args->display ); ?>" />
<?php
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant