In the user profile in Dashboard I have a section 'Contact info' containing email, URL, aim, yahoo, jabber. I would like to build a widget and output that user info within the widget. What function should I use to get just the contact info of a user?
|
|
It sounds like you're after the get_userdata() function. As a basic example, you could retrieve a users email like this:
|
|||
|
|
If you allow the user to arbitrarily add accounts without knowing what those accounts are up front you leave yourself open to problems. Say you have a
Assume this user can't spell and as above spells Facebook as Facecrooks. When you iterate over these custom results the output will be erroneous. If you also choose to display this information elsewhere, then the same erroneous information will be displayed. To retrieve the values, you would do,
Your best approach would be to define the social networks first so they can choose from a list. Even if you decide to create a new meta_key per entry you are still going to be faced with the same problems of user input errors. I would define my own list of social networks in a drop down with a input text field for their URL and then use, The values you would get from the
Then,
To display its the same deal,
|
|||||
|