| 1 |
<?php |
| 2 |
$class = 'wp-block-getwid-field-email'; |
| 3 |
$block_name = $class; |
| 4 |
if ( isset( $attributes[ 'className' ] ) ) { |
| 5 |
$class .= ' ' . $attributes[ 'className' ]; |
| 6 |
} |
| 7 |
$uid = isset( $attributes[ 'id' ] ) ? $attributes[ 'id' ] : 'email-' . uniqid(); |
| 8 |
$label = isset( $attributes[ 'label' ] ) ? $attributes[ 'label' ] : __( 'Email address', 'getwid' ); |
| 9 |
?> |
| 10 |
<p class='<?php echo esc_attr( $class );?>'><?php |
| 11 |
if ( ! empty( $label ) ) : ?> |
| 12 |
<label |
| 13 |
for='<?php echo esc_attr( $uid ); ?>' |
| 14 |
class='<?php echo esc_attr( $block_name . '__label' );?>' |
| 15 |
><?php |
| 16 |
echo wp_kses_post( $label ); |
| 17 |
?></label> |
| 18 |
<?php endif; ?> |
| 19 |
|
| 20 |
<input id='<?php echo esc_attr( $uid ); ?>' type='email' name='email' <?php |
| 21 |
if ( isset( $attributes[ 'placeholder' ] ) ) { ?> |
| 22 |
placeholder='<?php echo esc_attr( $attributes[ 'placeholder' ] ); ?>' <?php |
| 23 |
} |
| 24 |
|
| 25 |
if ( isset( $attributes[ 'required' ] ) ) { ?> |
| 26 |
required=''<?php |
| 27 |
} ?> |
| 28 |
/> |
| 29 |
</p> |
| 30 |
|