Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is it possible to show the Biographical Info textfield while creating a new user? I know it's possible to add user bio by editing a user AFTER it has been created. But I would like to do this while creating the user.

share|improve this question
    
Are you using a custom front end registration? Or are you adding users manually via the back end of the system? –  Nicole Nov 29 '12 at 14:19
    
i'm adding users via the back end –  Jules Nov 29 '12 at 14:29
    
@Jules Any progress on this question? –  kaiser Feb 9 '13 at 1:14
    
@kaiser: i don't need this anymore. But I think Ralf912's answer is correct. Someone might want to rewrite it as a plugin. –  Jules Feb 12 '13 at 10:33

1 Answer 1

up vote 4 down vote accepted

No. There are no hooks or filters to add an input field to the create user form.

Maybe it is possible to add an input field via jQuery. I have not tested it.

If it is pssible to add an input field, than it should be possible to save this information because the process of creating an user is the same as updating an existing user.

Update

Yes, it is possible to add an input field with jQuery. And yes, it is possible to add extra data to the user creation.

As long as you use the same fields which are on the edit user screen, it's only a hand full lines of code:

PHP

add_action( 'admin_print_scripts-user-new.php', 'add_jquery' );

function add_jquery(){

    wp_enqueue_script(
        'add_input_field',
        plugins_url( 'stackexchange.js', __FILE__ ),
        array( 'jquery' ),
        false,
        true
    );

}

JS

jQuery( document ).ready(

    function($){

        var insertElements = 
            '<tr class="form-field">' +
            '   <th scope="row"><label for="description">Biographical Info</label></th>' +
            '   <td><textarea name="description" id="description" rows="5" cols="30"></textarea><br /><span class="description">Share a little biographical information to fill out your profile. This may be shown publicly.</span></td>' +
            '</tr>';

        $( '#createuser .form-table tbody' ).append( insertElements );

    }

);

I simply enqueued a javascript file to the new user screen. In this javascript, the markup for the table row and input field is appended to the table.

In this example I just copy the markup from the edit user screen. So there is no need to do anything else because, as i mentioned above, creating an user is the same process as editing an user.

If you wish to create your own field (e.g. a field for a link to a twitter profile), than you have to hook into the edit users data and show users data. There are a lot of very good examples and tutorials on the net about this topic. One you can finde at WP Engineers.

share|improve this answer
1  
Also a answer on WPSE for user profile and wp-signup –  bueltge Dec 3 '12 at 7:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.