Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom fields to user #13

Open
pbolger opened this issue Oct 20, 2012 · 2 comments
Open

Add custom fields to user #13

pbolger opened this issue Oct 20, 2012 · 2 comments

Comments

@pbolger
Copy link

pbolger commented Oct 20, 2012

Hi

I'm trying to add custom fields to my users - phone, cell and the like. This works fine in the back end, the form elements appear and seem to save, but I can't seem to get the values back in a template.
If I use

 <?php 

 foreach($values as $value)
 {
      echo '<pre >';
           print_r($value);
      echo '</pre >';
 }

?>

I can only see the native user fields.

Array
 (
      [ID] => 3
      [user_firstname] => 
      [user_lastname] => 
      [nickname] =>
      [user_nicename] =>
      [display_name] => 
      [user_email] => 
      [user_url] => 
      [user_registered] => 2012-08-21 21:53:18
      [user_description] => This is my description field.
  )

(values redacted)

@shaunbent
Copy link
Collaborator

This add-on only returns the all the native user fields. You would have to take the users ID and use a get_user_meta query to grab any custom meta details. I will look to see if there is a way to grab all the other user_meta and add it to the returned array.

@pbolger
Copy link
Author

pbolger commented Feb 21, 2013

Here's some discussion about this at the ACF forums.

http://support.advancedcustomfields.com/discussion/1207/add-custom-field-to-user/p1

It'd be really nice to be able to do this. My goal a DRY cms: 'people' should only exist in one place, and the WP user list is the obvious one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants