Estou com problemas para grava o banco de dados de campos extras adicionais como endereço por exemplo, já segui todas as instruções da documentação.
Já criei o child-theme, copy files, chance name for Tutor, etc…
*function.php
->
add_filter('tutor_student_registration_required_fields', 'required_adress_no_callback');
if ( ! function_exists('required_adress_no_callback')){
function required_adress_no_callback($atts){
$atts['adress'] = 'Endereço';
return $atts;
}
}
add_action('user_register', 'add_adress_after_user_register');
add_action('profile_update', 'add_adress_after_user_register');
if ( ! function_exists('add_adress_after_user_register')) {
function add_adress_after_user_register($user_id){
if ( ! empty($_POST['adress'])) {
$end = sanitize_text_field($_POST['adress']);
update_user_meta($user_id, '_adress', $end);
}
}
}
*registration.php
->
<div class="tutor-form-col-6">
<div class="tutor-form-group">
<label>
<?php _e('Endereço', 'tutor'); ?>
</label>
<input type="text" name="adress" value="<?php echo tutor_utils()->input_old('adress'); ?>" placeholder="<?php _e('Endereço', 'tutor'); ?>" required="required">
</div>
</div>
</div>
*myprofile.php
->
$end = get_user_meta( $uid, 'adress',true );
array( __( 'Endereço', 'tutor' ), ($end ? $end : 'Informação registrada' )),
*try user tihs too, in a other time ->*
<div class="tutor-dashboard-profile-item">
<div class="heading">
<span><?php _e('Endereço', 'tutor'); ?></span>
</div>
<div class="content">
<p><?php echo $end ? $end : "________"; ?> </p>
</div>
</div>
*user_profile_fields.php -> <tr class="user-description-wrap"> <th><label for="description"><?php esc_html_e( 'Endereço', 'tutor' ); ?></label></th> <td> <input type="text" name="adress" id="adress" value="<?php echo esc_attr( get_user_meta( $user->ID, '_adress', true ) ); ?>" class="regular-text" /> </td> </tr>
prifile.php -> <div class="tutor-row"> <div class="tutor-col-12 tutor-col-sm-6 tutor-col-md-12 tutor-col-lg-6 tutor-mb-32"> <label class="tutor-form-label tutor-color-secondary"> <?php esc_html_e( 'Endereço', 'tutor' ); ?> </label> <input class="tutor-form-control" type="text" name="endereco" value="<?php echo esc_attr( $user->Endereco ); ?>" placeholder="<?php esc_attr_e( 'Endereço', 'tutor' ); ?>"> </div>
Not working, can help me?
i try https://docs.themeum.com/tutor-lms/developers/custom-field-on-registration/
this: https://webtoptemplates.com/add-registration-custom-field-tutor-lms/
and this: https://www.wppluginsforyou.com/tutor-lms-how-to-add-custom-field-in-registration-page/
The page I need help with: [log in to see the link]