Created
June 22, 2013 08:00
-
-
Save infusedmj/5836280 to your computer and use it in GitHub Desktop.
Add this to your theme's function.php to show first name and last name fields on woocommerce's registration page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function woo_new_fields() { | |
?> | |
<p class="form-row"> | |
<label for="first_name"><?php _e( 'First Name', 'woocommerce' ); ?> <span class="required">*</span></label> | |
<input type="text" class="input-text" name="first_name" id="first_name" value="<?php if (isset($_POST['first_name'])) echo esc_attr($_POST['first_name']); ?>" /> | |
</p> | |
<p class="form-row"> | |
<label for="last_name"><?php _e( 'Last Name', 'woocommerce' ); ?> <span class="required">*</span></label> | |
<input type="text" class="input-text" name="last_name" id="last_name" value="<?php if (isset($_POST['last_name'])) echo esc_attr($_POST['last_name']); ?>" /> | |
</p> | |
<?php | |
} | |
add_action( 'register_form', 'woo_new_fields', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment