How To Extend User Contact Info in WordPress

WordPress 2.9 was built with the new ability to extend the User Contact Info fields, this trick can be done by adding some code on functions.php within your current theme.

We can add lots of contact information, depending upon your needs. To extend user contact info, open the files and add in this code

1
2
3
4
5
6
7
8
9
10
11
<?php
function my_new_contactmethods( $contactmethods ) {
    // Add Twitter
    $contactmethods['twitter'] = 'Twitter';
    //add Facebook
    $contactmethods['facebook'] = 'Facebook';
    return $contactmethods;
}
add_filter('user_contactmethods','my_new_contactmethods',10,1);
?>

And the result of this trick will be like this,

Extend-WordPress-User-Info-460x281

This is only a basic example and you can make it more complicated depending on your creative needs ;)

2 thoughts on “How To Extend User Contact Info in WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>