0

I'm currently modifying a theme, freelanceengine, and I'd to add some customs fields in profile editing page. I succeed in creating the customs fields but my changes are not saved

    <div id="region_f" class="fre-input-field">
    <?php

    ae_tax_dropdown( 'region',
    array(
    'attr'            => 'data-chosen-width="100%" data-validate_filed = "' . $validate_region . '" data-chosen-disable-search="" data-placeholder="' . __( "Sélectionner votre région", ET_DOMAIN ) . '"',
    'class'           => 'fre-chosen-single',
    'hide_empty'      => 0,
    'hierarchical'    => false,
    'id'              => 'region',
    'selected'        => $region_arr,
    'show_option_all' => __( "Sélectionner votre région", ET_DOMAIN );
 ?>
 </div>

The var is define like this :

$region        = isset( $profile->tax_input['region'][0] ) ? $profile->tax_input['region'][0]->name : '';

I'd like to save the value of the taxonomy region and show it in the Front end but I can't find how this theme does it.

Any clues ? Thank you

Edit

I tried to manipulate functions and code according to Steve North's link This is what I tried, can't save the changes.

<?php if ( function_exists( 'extra_user_profile_fields' ) || 'save_extra_user_profile_fields' ) {
  $adress = get_user_meta( $user_id, 'address', $_POST['address'] );
    if ( empty ($adress)) { ?>
<form id="adress">
  <div class="profile-employer-secure cnt-profile-hide" id="cnt-account-default" style="display: block">
    <label for="address"><?php _e( 'Adress', ET_DOMAIN ) ?></label>
    <input type="text" name="address" id="address" value="<?php echo esc_attr( get_the_author_meta( 'address', $user->ID ) ); ?>" class="regular-text" /><br />
    <span class="description"><?php _e("Please enter your address."); ?></span>
    <input type="submit" class="fre-normal-btn fre-btn" name="" style="width: 100%" value="<?php do_action('save_extra_user_profile_fields'); ?>">
  </div>
</form>
<?php }
} ?>

I tried to create but and call the function save but I guess it's not how to do it.

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.