Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • SLIcore Design
    Participant

    @slicore-design

    Hi there, notlicht!
    I know this was a while ago but I was wondering if you got your function to work and have your xprofile data showing in your WP admin user list.

    I have been at this for hours and I just now got it to work… by accident!

    I honestly have this thread to thank because none of the others worked.

    I worked off your code above and did the following to bring in users’ dogs’ names into my admin area.

    add_action( ‘manage_users_custom_column’, ‘dogname_column’, 15, 3 );
    add_filter( ‘manage_users_columns’, ‘modify_user_table’, 15 );

    function dogname_column( $value, $column_name, $id) {
    if ( ‘dogname’ == $column_name)
    {
    $doggycolumn = xprofile_get_field_data( ‘2’, $id );
    return $doggycolumn;
    }
    }

    function modify_user_table( $column ) {
    $column[‘dogname’] = ‘Dog\’s Name’;
    return $column;
    }

    None of this worked until I put the 2 for $field_id in single quotes in the arguments for xprofile_get_field_data, forgot that I put it in quotes, and then refreshed my website’s page. There were all the dog names! I don’t know how that works. I guess ID numbers are closer to strings than integers?

    Anyway, that’s what did it for me. Don’t ask me why this was so important to have dog names in my user list… call it a challenge.

    I hope yours worked!

Viewing 1 replies (of 1 total)
Skip to toolbar