Answer the question
In order to leave comments, you need to log in
How to add extra fields to theme my login wordpress plugin registration form?
Greetings! On a site with a wordpress engine and the Theme My Login plugin installed, I want to add the following fields to the existing fields (Login, password, e-mail) in the registration template (Last name, First name, Mobile phone, gender), but the problem is that these fields are in the database does not save .. How to add them correctly?
<p><input type="text" name="user_login" id="user_login<?php $template->the_instance(); ?>" value="<?php $template->the_posted_value( 'user_login' ); ?>" class="regular-text" /></p>
<p><label for="last_name<?php $template->the_instance(); ?>">Фамилия:<span class="necessarily">*</span></label><input type="text" name="last_name" id="last_name<?php $template->the_instance(); ?>" class="regular-text" value="<?php $template->the_posted_value( 'last_name' ); ?>" /></p>
<p><label for="first_name<?php $template->the_instance(); ?>">Имя:<span class="necessarily">*</span></label><input type="text" name="first_name" id="first_name<?php $template->the_instance(); ?>" class="regular-text" value="<?php $template->the_posted_value( 'first_name' ); ?>" /></p>
<?php
$show_password_fields = apply_filters( 'show_password_fields', true, $profileuser );
if ( $show_password_fields ) :
?>
<div id="password">
<p><label for="pass1">Пароль:<span class="necessarily">*</span></label><input type="password" name="pass1" id="pass1" size="16" autocomplete="off" /></p>
<p><label for="pass2">Повторить пароль:<span class="necessarily">*</span></label><input type="password" name="pass2" id="pass2" size="16" autocomplete="off" /></p>
</div>
<?php endif; ?>
<p><label for="user_email">E-mail:<span class="necessarily">*</span></label><input type="email" name="user_email" id="user_email<?php $template->the_instance(); ?>" value="<?php $template->the_posted_value( 'user_email' ); ?>" class="regular-text" /></p>
<p><label for="user_tel">Мобильный телефон:<span class="necessarily">*</span></label><input type="tel" name="tel_number" pattern=".{7,}" id="tel_number<?php $template->the_instance(); ?>" value="<?php $template->the_posted_value( 'tel_number' ); ?>" class="regular-text" size="20" /></p>
<p class="form-row form-row-last">
<label for="user_gender">Пол:</label>
<input type="radio" name="gender" value="мужской" <?php checked('мужской', get_user_meta($profileuser->ID, 'gender', true)); ?>>мужской
<input type="radio" name="gender" value="женский" <?php checked('женский', get_user_meta($profileuser->ID, 'gender', true)); ?>>женский
</p>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question