Extra User Details WordPress Plugin

eud

Here is the simple plugin that allows you to add extra fields to the user profile page (e.g. social media links to Facebook, Twitter, LinkedIn profiels etc).

Extra fields can be easily accessed in your templates like a general wordpress author details:

get_usermeta( $userid, $metakey);

Plugin uses WP’s usermeta table. You can add and edit necessary fields at plugin options section in backend.

In case you need it – you can download it here.

Contributors:
Spanish translation – Maria Ramos

48 thoughts on “Extra User Details WordPress Plugin

  1. Rich Gilberto

    Vadim, thank you for this plugin, it is exactly what I need.

    Unfortunately, though, I’m having a bit of trouble implementing it on a Bios page for a band I’m currently working with. It seems as if I can post standard field data (using get_usermeta) but extra fields do not display in this manner. After hours of trying to fix it, I’ve come to the conclusion that there is something different about the way this plugin stores info to the usermeta database. I would greatly appreciate it if you could contact me to help me fix this because it could a) help improve your plugin or b) prove me wrong.

    Thank you once again!

    Rich

    Reply
    1. admin Post author

      Hi Rich,

      To retrieve extra fields you can use your get_usermeta() (http://codex.wordpress.org/Function_Reference/get_usermeta) function, but please note about parameters:

      get_usermeta ( $userid, $metakey )

      so for metakey you need to use field’s slug displayed at extra fields settings near every extra added field.

      //I can think of renaming the slug to metakey at the Extra Fileds Settings…

      Reply
  2. Rich Gilberto

    I know how to do it, but it wasn’t working.
    I found the problem – your plugin doesn’t properly apply update_usermeta and therefore after entering in the extra details on the profile page and clicking “update” they disappear.

    There is built in functionality in WP2.9 as described here:
    http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields

    You should update your plugin accordingly. It’s still very useful because people much prefer the graphical interface than adding code like this by hand.

    Thanks for taking the time to respond,
    Rich

    Reply
    1. admin Post author

      I can’t duplicate this bug, I can look it at your site if you need help. Write me on Skype then.

      Thanks for checking out this plugin!

      Reply
      1. René

        I have the same problem. When updating another user’s custom user fields, they don’t stick _and_ my own custom user fields are wiped.

        I can update my own afterwards again, though.

        Reply
          1. René

            Thanks for the effort. Unfortunately the 0.1.1 version doesn’t read my Extra User Details from the database (the ones I made with 0.1), so they neither show on the settings page nor on the individual user profile (backend, that is).

            Thoughts?

            Reply
  3. darrin stern

    Ok I am a new guy to WP so im a little lost. I have added your plugin because I wanted to have extra fields in my user data which will later be displayed in a roster of team members.

    So how do I add the fields to the user profile? I have set them up but whats the next step.

    Please help.

    Thanks,
    Darrin

    Reply
    1. admin Post author

      Go to Settings -> Extra User Details and add necessary fields, so they appear on edit profile page. And then use them in your template as get_usermeta ( $userid, $slug ) as mentioned above.

      Reply
  4. Yassir

    Hi,
    thanks for this plugin. But i have a problem when i try to update a user profile from the admin panel .
    the update dosen’t work if an administrator try to modify the meta data of an other user.

    Reply
  5. Yassir

    oups the correct add
    if(!isset($get_user_id)) {$get_user_id = empty($_POST[‘user_id’])?null:$_POST[‘user_id’];}

    and thanks for your plugin

    Reply
  6. Dean Hodges

    Hi there,

    when i use your plugin and perform a serach, i get the following:

    “Not Found
    The requested URL /members was not found on this server.”

    Can you help

    Reply
  7. Omar

    hi im trying to make the extra fields to appear on the user info page but it doesn’t !

    yes im using a template and no i don’t know how to write codes so can you help me here ?

    Reply
    1. admin Post author

      You might be looking for something like this:

      < ?php global $wp_query; $curauth = $wp_query->get_queried_object();

      echo get_usermeta( $curauth->ID, ‘metakey1’ );

      ?>

      and so on…

      Reply
    1. admin Post author

      Then you need to request some support, I can’t help when I don’t see what’s going on…

      Reply
  8. Drew

    How hard would it be to integrate an image uploader? I know WP supports Gravatars out of the box, but I’m looking for a local solution.

    Yes, I know I can upload new media and just enter the path using this plugin, but if there’s a built-in function to do this, that would be great.

    Reply
  9. Joe Greenwood

    Hello, thank you for this plugin … I add a whole bunch of New Extra Fields, such as ‘city’, ‘state’, ‘zip code’, ‘phone number’, ‘fax number’ etc. etc. … but on admin page, edit user, I see only the very last New Extra Field that I added … none of the others that I added are showing on the edit user page in admin panel. how can i get this?

    thank you again for plugin

    Reply
  10. Allan White

    Vadim, thanks for writing this plug-in. I’m using it right now on a new blog, and it seems to work.

    2 Suggestions:

    – The admin screen is a bit confusing. After adding a field, I have to click on the CP link to reload it; several times the field got deleted or wasn’t set.
    – The fields that are created aren’t very flexible in the post screen. It would be nice to be able to specify a text area or text box of variable width.

    But that’s minor! Thanks for writing this plugin. Spasiba!

    Reply
  11. Jrf

    Hi Vadim,

    Thanks for your plugin! I liked it so much that I couldn’t help but give back to it by doing this rewrite. Please provide me with your email address so I can mail you the new code.

    First of all, let me state clearly that I’m not all that familiar with WordPress or the WordPress plugin API, so no doubt there will be things which I have missed as I didn’t know that is the way things should be done.
    One thing which comes to mind straight away and which I haven’t looked at, is validating that only users with admin-level priviledges can edit the settings.

    The reason I started looking at the code was the none-showing of fields after you’ve added a new field (I had to go to another screen, then come back to see the list of fields again).
    Additionally, if you would add another field – without first reloading the screen-, all previously defined fields would be gone from the database, which was a pain.

    Also if you would change the ‘field label’, you would also change the meta key and lose access to the values which users had already provided.

    Ok, so I solved that and as I was working on the code anyway, I solved some other (potential) issues and added some new features…..

    What I’ve done:

    * Rewritten the whole admin function to solve the bugs. If you change the field label now, only the label will change, not the meta-key. And the field list will show correctly after adding new fields.
    * Replaced some depreciated WP-functions with their replacements and added backward compatibility for those.
    * Replaced all text strings which didn’t have this, with the __() function to prepare the plugin for translating. I haven’t added a language directory yet nor added any translations, I just made the actual plugin code ready for setting this up.
    * I also corrected some of the English phrases.
    * Added input validation to the admin function. Main restriction: meta keys and labels may now only contain alphanumerical characters within the current locale and spaces.
    * Added output validation wherever output was created.
    * New feature: added a ‘help text’ input field so admins can define their own help text to be displayed next to the profile field.
    * New feature: added a ‘field order’ input field so admins can change the order in which the fields are displayed on user profiles. If two fields were given the same order number, they are sorted by their alphabetic meta key.

    I’ve tried to maintain backward compatibility, but I’ve only tested in WP 3.0.1.

    I’d appreciate your feedback and hope you will consider these changes as the compliment to your work which they are meant to be.

    It would be great if you would incorporate my changes into a new version of the plugin so that other people can benefit as well 😉

    Smile,
    Juliette

    Reply
  12. Becky

    Thanks so much for this… have been pulling my hair out looking for a simple, usable solution. Yours was the 5th plugin I tried, and whilst I echo Allan’s request for more data types (a drop down box would be fabulous), I’m very pleased with this plugin. Thanks again!

    Reply
  13. Daniella Valentin

    Hello

    I had a problem using this plugin. I had the notification:

    “Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in /home/daniella/workspace/swathq/public/wp-includes/functions.php on line 3321”

    To fix this, when you add the submenu:

    “add_submenu_page( ‘users.php’, ‘Extra User Details Options’, ‘Extra User Details’, 8, ‘extra_user_details’, ‘eud_plugin_options’ );”

    the param for $capability (8 in the code above) is settting a user level, not a capability. From the wordpress page:

    “The capability required for this menu to be displayed to the user. User levels are deprecated and should not be used here! ”

    see more: http://codex.wordpress.org/Adding_Administration_Menus

    Cheers and thanks for the plugin

    Reply
  14. Groft

    Hi,
    I’m a new user to WordPress! Not new to php though. So just learning and experimenting the engine and the features. I would greatly appreciate your help if you could clarify my problem below. Thanks in advance.

    Is there anyway that I can use the metakey without using the user ID? Lets say, if I pass only the metakey in the get_usermeta(‘designation’); will this give u the designation of the user of the current article?

    Secondly, I would like to add country flag of the user when they comment on the blog. Is there any cool way that I can do it?

    Thanks a lot,

    Reply
    1. Vadym Khukhrianskyi Post author

      Hi, please use < ?php the_author_meta('designation'); ?> as I have explained in plugin description.

      Reply
  15. Ponç J. Llanears

    Thanks Vadim… this plugin was what I need.

    I’m upgrading a web form 2.9 to 3.3… I have found that the EUD are not shown in the profile in the new version.

    The solution, change this line
    if ( isset($value[3]) && !empty($value[3]) && $value[3] != 'disable' && current_user_can($value[3]) ) {
    for this other
    if ( isset($value[3]) && !empty($value[3]) && ( $value[3] != 'disable' ) && current_user_can($value[3]) ) {

    The “(…)” in the 3rd condition does the trick.

    Thank you very much for this plugin.

    Reply
  16. mlcy

    hi there, i am using this plugin on a multisite setup wordpress. i love it. it has been working great. i added a new site recently, it doesn’t seem like the plugin shows up on the new user profiles that i created for the new site. do you have any clue why that happened? how can i fix it? thanks a lot for your help.

    Reply
  17. John Cole

    Hi Vadim,

    I just starting working with a client who is using this plugin and reports that it broke after he upgraded his install to WP 3.3.1.

    The behavior we’re seeing is that pre-existing field data is no longer displaying in the User Edit view post-upgrade.

    Have you seen this before after an upgrade? Is there a way to verify that the user data still resides in the database? How can I look for this? Anything else to check?

    Thanks!
    John

    Reply
    1. admin Post author

      Hey, I just tried to do fresh install WP 3.1, installed EUD 0.3 plugin, created few fields and populated values. Then automatically upgraded WP to 3.3.1 and checked fields again. They were there still after upgrade.

      Concerning the database, sure, if those fields are no longer displayed in user profile, they should still reside in database. If you can’t fix the issue, can you please email me more details (wp version before upgrade, php version) through the contact form for example.

      Also, there’s going to be a major update soon.

      Reply
  18. John Cole

    Hi Vadmin,

    I really appreciate your help on this. I checked the DB tables and the user meta data all appears to be in there. So, it seems to be a matter of the data not being pulled out in the admin user editor.

    Apparently this happened during a 3.1.3 to the 3.3.1 upgrade.

    What’s the timing on the major update?

    I’ll follow up in the contact form as suggested.

    Reply
  19. John Cole

    Vadym,

    Is there a recommended way of only allowing the extra user details to be visible on the User Edit page for admins?

    I could put in some logic on my end, but I don’t want to veer off your development path.

    Reply
    1. Vadym Khukhrianskyi Post author

      Hi John,

      Of course, right to a tee there’s “Access level” column for every field on the right with the option: “Admins Only”.

      Reply
  20. Joshua Dance

    Thanks for the plugin.

    Just FYI for everyone using the plugin, if you add new fields, they won’t display unless you deactivate w3 Total Cache, then reactivate it.

    Reply
  21. Greg

    First off, nice work Vadym thank you!

    Everything works fine, as far as data being stored in MySQL. When users edit their profile, all of the extra fields I’ve added work fine, and I can see them in the database no problem. However, I’m having some issues pulling information with get_usermeta.

    If I try to use get_usermeta on a field already built into WordPress, like ‘last_name’ for example my site has no issue. Although, if I try get the meta_key for an extra field I get nothing back.

    For Example the following works fine


    global $current_user;
    get_currentuserinfo();
    $user_id = $current_user->ID;
    $user_info = get_usermeta( $user_id, 'last_name');
    echo $user_cu;

    That being said, if I try $user_info = get_usermeta( $user_id, ‘my_extra_field_metakey’);

    my site returns and empty string.

    Could you possibly point me in the right direction as to why this is happening?

    Thanks,
    Greg

    Reply
    1. Greg

      Nevermind, use get_user_meta instead of get_usermeta as it has since been deprecated.

      My only other question, is there anyway I can require certain fields?

      Thanks!

      Reply

Leave a Reply

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