Forums

[resolved] Problems with new field to user profile (2 posts)

  1. carlla
    Member
    Posted 2 years ago #

    I am trying to add a new field to user profile, but I could not get the data after saving it.

    I'm tying that:

    add_action( 'show_user_profile', 'show_profile' );
    add_action( 'edit_user_profile', 'show_profile' );
    
    function show_profile( $user )
    {
    ?>
    My field:
    <input name='newfield' value='<?php echo get_usermeta('newfield', $user->ID)?>' />
    <?
    }

    The data is saved in the database, but I can not recover data back to fill out that field.

    Can anyone help me to find out what I am doing wrong ?

  2. carlla
    Member
    Posted 2 years ago #

    Solved!

    I added global $user_ID
    and changed to get_the_author_meta( 'newfield', $user_ID );

Topic Closed

This topic has been closed to new replies.

About this Topic