Support » Fixing WordPress » Customized registration form – want to collect user’s URL

  • Hello,

    I’m allowing users to register themselves on my blog. The default form collects their username and email address, and that’s it. Later on, after they register they can update their profile to include other information, such as their own website address.

    I’d really like to be able to collect their webside address when they first register on my site (and also have that URL displayed in the “new user” email notification I receive). Also, when they enter their site URL upon registration, it should automatically be saved in that field in their user profile.

    Is there a way to do this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Without any knowledge of PHP?

    There are two files

    wp-register.php in main dir
    -modify form
    -add url-parsing (exists…)
    -call wp_create_user

    registration-functions.php
    function wp_create_user
    -create user (add url)

    Hi Muelheim,

    Thanks for the quick reply, I really appreciate it. I’ve searched these boards high and low for what in my mind should be a simple customization, but so far have found nothing.

    I have only limited javascript and php skills… would you mind expanding in more detail on the advice you’ve offered?

    Thanks!

    Kristi

    anyone else have any advice?

    Muel, are you saying that :

    $user_id = wp_create_user( $user_login, $password, $user_email ); needs to be changed to something like

    $user_id = wp_create_user( $user_login, $password, $user_email, $user_name, $user_url );

    Also, by “-add url-parsing (exists…)” did you mean changing the form to include something like this::

    <p><label for=”user_name”><?php _e(‘Namer:’) ?></label>
    <input type=”text” name=”user_name” id=”user_name” size=”20″ maxlength=”100″ value=”<?php echo wp_specialchars($user_name); ?>” /></p>

    <p><label for=”user_url”><?php _e(‘Web Site:’) ?></label>
    <input type=”text” name=”user_url” id=”user_url” size=”20″ maxlength=”100″ value=”<?php echo wp_specialchars($user_url); ?>” /></p>

    Well I did this and it worked I also modified registration-functions.php by changing the following code::

    This line-
    function wp_create_user( $username, $password, $email, = ”) {
    global $wpdb;

    $user_login = $wpdb->escape( $username );
    $user_email = $wpdb->escape( $email );
    $user_pass = $password;

    $userdata = compact(‘user_login’, ‘user_email’, ‘user_pass’);
    return wp_insert_user($userdata);
    }

    to this-

    function wp_create_user( $username, $password, $email, $firstname, $lastname, $url = ”) {
    global $wpdb;

    $user_login = $wpdb->escape( $username );
    $user_email = $wpdb->escape( $email );
    $user_pass = $password;

    $userdata = compact(‘user_login’, ‘user_email’, ‘user_pass’);
    return wp_insert_user($userdata);
    }

    and this –

    function create_user( $username, $password, $email ) {
    return wp_create_user( $username, $password, $email );
    }

    to this-

    function create_user( $username, $password, $email, $firstname, $lastname, $url ) {
    return wp_create_user( $username, $password, $email, $firstname, $lastname, $url );
    }

    seems to work, but the form field is still a bit wonky.

    I parsed the three new lables the same as the default ones were parsed, and still the form fields are smaller. Why?

    A solution!

    Force User Field Registration:

    Force User Field Registration

    OMG you freaking rock man!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Customized registration form – want to collect user’s URL’ is closed to new replies.