WordPress.org

Ready to get started?Download WordPress

Forums

Add (ICQ) field to user's profile (2 posts)

  1. Nefastis
    Member
    Posted 8 years ago #

    In the file 'template-functions-author.php' I've found the function 'get_the_author_icq()' and tried to add the user's icq# after the fashion of template functions in 'registration-functions.php' and in 'user-edit.php'. OK, the field ICQ appeared in user profile, but it's not saved after updating profile. And thus, Loop function '<?php the_author_icq(); ?>' does not work. How should I make it right?

  2. Nefastis
    Member
    Posted 8 years ago #

    So, I searched by now some more files and:
    1. in 'user-edit.php' I've added:

    <?php _e('ICQ:') ?>
    <input type="text" name="icq" value="<?php echo $profileuser->icq ?>" />

    2. in 'registration-functions.php':

    update_usermeta( $user_id, 'icq', $icq );

    3. in 'template-functions-author.php':

    function get_the_author_icq() {
    global $authordata;
    return $authordata->icq;
    }

    function the_author_icq() {
    echo get_the_author_icq();
    }

    4. in 'admin-functions.php':

    if (isset ($_POST['icq']))
    $user->icq = wp_specialchars(trim($_POST['icq']));
    </strong

    5. in 'profile.php':

    <?php _e('ICQ:') ?>
    <input type="text" name="icq" value="<?php echo $profileuser->icq ?>" />
    </strong

    and icq# is now saved. Did I make everything right?

Topic Closed

This topic has been closed to new replies.

About this Topic