[Plugin: Theme My Login] Extra fields on the registration form [Website]
-
I tried adding a field where users insert the URL of your website but this is not saved in your profile
Here’s what I did, what am I doing wrong?register-form.php
<p> <label for=”user_url<?php $template->the_instance(); ?>”><?php _e( ‘Website’, ‘theme-my-login’ ) ?></label> <input type=”text” name=”user_url” id=”user_url<?php $template->the_instance(); ?>” class=”input” value=”<?php $template->the_posted_value( ‘user_url’ ); ?>” size=”20″ tabindex=”20″ /> </p>
theme-my-login-custom.php.
function tml_registration_errors( $errors ) { if ( empty( $_POST['user_url'] ) ) $errors->add( ‘empty_user_url’, ‘ERROR: Introduzca la dirección de su página web.’ ); return $errors; } add_filter( ‘registration_errors’, ‘tml_registration_errors’ ); function tml_user_register( $user_id ) { if ( !empty( $_POST['user_url'] ) ) update_user_meta( $user_id, ‘user_url’, $_POST['user_url'] ); } add_action( ‘user_register’, ‘tml_user_register’ );
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘[Plugin: Theme My Login] Extra fields on the registration form [Website]’ is closed to new replies.