custom field for user not visible on Edit profile
-
Hi,
Thanks for this amazing plugin,
I have a small concern which is regarding the visibility of the custom user profile fields that are not visible on the Edit profile page.
I used the following code for addition of a custom field to the user profile,add_action( ‘show_user_profile’, ‘my_show_extra_profile_fields’ );
add_action( ‘edit_user_profile’, ‘my_show_extra_profile_fields’ );function my_show_extra_profile_fields( $user ) { ?>
<h3>Extra profile information</h3>
<table class=”form-table”>
<tr>
<th><label for=”twitter”>Twitter</label></th><td>
<input type=”text” name=”twitter” id=”twitter” value=”<?php echo esc_attr( get_the_author_meta( ‘twitter’, $user->ID ) ); ?>” class=”regular-text” /><br />
<span class=”description”>Please enter your Twitter username.</span>
</td>
</tr></table>
dd_action( ‘personal_options_update’, ‘my_save_extra_profile_fields’ );
add_action( ‘edit_user_profile_update’, ‘my_save_extra_profile_fields’ );function my_save_extra_profile_fields( $user_id ) {
if ( !current_user_can( ‘edit_user’, $user_id ) )
return false;/* Copy and paste this line for additional fields. Make sure to change ‘twitter’ to the field ID. */
update_usermeta( $user_id, ‘twitter’, $_POST[‘twitter’] );
}
<?php }the addition of the new field was successful but I could not find the newly added field on the Edit profile page. I checked the profile builder > manage field, option but could not find the new field.
Thanks!
- The topic ‘custom field for user not visible on Edit profile’ is closed to new replies.