• I chose this option:

    and added the code to my functions.php:

    function modify_contact_methods($profile_fields) {
    
    	// Add new fields
    	$profile_fields['tel'] = 'Telefon';
    
    	return $profile_fields;
    }
    add_filter('user_contactmethods', 'modify_contact_methods');

    and added this field to profile-form.php:

    <h3><?php _e( 'Contact Info' ); ?></h3>
    
    		<table class="form-table">
    		<tr>
    			<th><label for="email"><?php _e( 'E-mail' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
    			<td><input type="text" name="email" id="email" value="<?php echo esc_attr( $profileuser->user_email ); ?>" class="regular-text" /></td>
    		</tr>
    		<tr>
    			<th><label for="tel">Telefon</label></th>
    			<td><input type="text" name="tel" id="tel" value="<?php echo esc_attr( $profileuser->user_tel ); ?>" class="regular-text code" /></td>
    		</tr>
    
    		</table>

    when I update this field on my profile page, it is updated in database (backend) but when I refresh my profile page, it shows now value (its empty in frontend). If I hit save button again, it will remove this field value from database.

    What shall I do to fix it?

    https://www.ads-software.com/plugins/theme-my-login/

  • The topic ‘Custom profile fields doesnt show values’ is closed to new replies.