WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Register plus: accessing additional user info (3 posts)

  1. lorenzo
    Member
    Posted 5 years ago #

    hello guys,

    i've been digging around for quite some time, but cannot find the answer to this problem.

    if i want to conditionally present content based on user information in a sidebar (from the user table) i found quite a lot of info (ie
    http://codex.wordpress.org/Function_Reference/get_currentuserinfo
    or
    http://wordpress.org/support/topic/71804).

    i'm currently using the Register Plus plugin and would like to use the variable fields from the plugin (ie 'gender') to present two versions of the content. does anyone know how can i retrieve this info from the current ID?

    an example of code for a sidebar (not even trying to do anything with the info yet!):


    <?php global $userdata;
    get_currentuserinfo();

    echo('Username: ' . $userdata->user_login . "\n");
    echo('User level: ' . $userdata->user_level . "\n");
    echo('User ID: ' . $userdata->ID . "\n");

    echo('sex: ' . $userdata->??? . "\n");

    ?>

    i hope that somebody has suggestions, thanks!

  2. Haloscope
    Member
    Posted 5 years ago #

    This thread is exactly what you're looking for.

    http://wordpress.org/support/topic/196934?replies=8

  3. lorenzo
    Member
    Posted 5 years ago #

    thanks! the title of the other post was quite deceiving and i missed...
    much appreciated.

    i had high hopes for this tip, however the original call doesn't seem to work for me.

    I tried the very basic stuff in this format as suggested (note that i tried both in a page and in the sidebar):

    <?php
    if( get_user_option($option_name, $gender) ):
       echo get_user_option($option_name, $gender);
    endif;
    ?>

    the $gender variable is the name exactly as it was set in the RegisterPlus plugin.

    i also had a look at the get_user_option() function in the codex, but the page is actually blank! did anything change in the new 2.6 version (there are changes with user authentication, so i'm assuming there might be others)?

Topic Closed

This topic has been closed to new replies.

About this Topic