Browse Source

fix: aldine contact form warnings (#360)

pull/362/head
Felipe Dalcin 2 years ago committed by GitHub
parent
commit
ba4156d6a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 90
      partials/contact-form.php

90
partials/contact-form.php

@ -31,65 +31,67 @@ $honeypot = 'firstname' . wp_rand();
</label> </label>
</p> </p>
<p class="form__row"> <p class="form__row">
<input id="contact-name" <input
<?php id="contact-name"
if ( isset( $contact_form_response['field'] ) && $contact_form_response['field'] === 'visitor_name' ) : <?php if ( isset( $contact_form_response['field'] ) && $contact_form_response['field'] === 'visitor_name' ) : ?>
?> class="error"
class="error"<?php endif; ?> type="text" name="visitor_name" value=" <?php endif; ?>
<?php type="text"
if ( $contact_form_response['status'] === 'error' ) : name="visitor_name"
echo $contact_form_response['values']['visitor_name']; <?php if ( $contact_form_response && $contact_form_response['status'] === 'error' ) : ?>
endif; value="<?php echo $contact_form_response['values']['visitor_name']; ?>"
?> <?php endif; ?>
" required> required
/>
<label for="contact-name"> <label for="contact-name">
<?php _e( 'Your name (required)', 'pressbooks-aldine' ); ?> <?php _e( 'Your name (required)', 'pressbooks-aldine' ); ?>
</label> </label>
</p> </p>
<p class="form__row"> <p class="form__row">
<input id="contact-email" <input
<?php id="contact-email"
if ( isset( $contact_form_response['field'] ) && $contact_form_response['field'] === 'visitor_email' ) : <?php if ( isset( $contact_form_response['field'] ) && $contact_form_response['field'] === 'visitor_email' ) : ?>
?> class="error"
class="error" <?php endif; ?>type="email" name="visitor_email" value=" <?php endif; ?>
<?php type="email"
if ( $contact_form_response['status'] === 'error' ) : name="visitor_email"
echo $contact_form_response['values']['visitor_email']; <?php if ( $contact_form_response && $contact_form_response['status'] === 'error' ) : ?>
endif; value="<?php echo $contact_form_response['values']['visitor_email']; ?>"
?> <?php endif; ?>
" required> required
/>
<label for="contact-email"> <label for="contact-email">
<?php _e( 'Your email address (required)', 'pressbooks-aldine' ); ?> <?php _e( 'Your email address (required)', 'pressbooks-aldine' ); ?>
</label> </label>
</p> </p>
<p class="form__row"> <p class="form__row">
<input id="contact-institution" <input
<?php id="contact-institution"
if ( isset( $contact_form_response['field'] ) && $contact_form_response['field'] === 'visitor_institution' ) : <?php if ( isset( $contact_form_response['field'] ) && $contact_form_response['field'] === 'visitor_institution' ) : ?>
?> class="error"
class="error" <?php endif; ?>type="text" name="visitor_institution" value=" <?php endif; ?>
<?php type="text"
if ( $contact_form_response['status'] === 'error' ) : name="visitor_institution"
echo $contact_form_response['values']['visitor_institution']; <?php if ( $contact_form_response && $contact_form_response['status'] === 'error' ) : ?>
endif; value="<?php echo $contact_form_response['values']['visitor_institution']; ?>"
?> <?php endif; ?>
" required> required
/>
<label for="contact-institution"> <label for="contact-institution">
<?php _e( 'Your institution (required)', 'pressbooks-aldine' ); ?> <?php _e( 'Your institution (required)', 'pressbooks-aldine' ); ?>
</label> </label>
</p> </p>
<p class="form__row"> <p class="form__row">
<textarea id="contact-message" <textarea
<?php id="contact-message"
if ( isset( $contact_form_response['field'] ) && $contact_form_response['field'] === 'message' ) : <?php if ( isset( $contact_form_response['field'] ) && $contact_form_response['field'] === 'message' ) : ?>
?> class="error"
class="error" <?php endif; ?>name="message" required> <?php endif; ?>
<?php name="message"
if ( $contact_form_response['status'] === 'error' ) : required
echo $contact_form_response['values']['message']; ><?php if ( $contact_form_response && $contact_form_response['status'] === 'error' ) : ?>
endif; <?php echo $contact_form_response['values']['message']; ?>
?> <?php endif; ?></textarea>
</textarea>
<label for="contact-message"> <label for="contact-message">
<?php _e( 'Your message (required)', 'pressbooks-aldine' ); ?> <?php _e( 'Your message (required)', 'pressbooks-aldine' ); ?>
</label> </label>

Loading…
Cancel
Save