Support

Account

Home Forums Feature Requests User Field Documentation Missing

Helping

User Field Documentation Missing

  • Documentation for the User field is missing

    https://www.advancedcustomfields.com/resources/

    The user field has been in Acf since version 5, Please add the documentation.

  • Yep, I don’t think it has ever existed. I can’t add it but I can give you some information on the field.

    The user field returns either an user object that is the same as what is returned by get_userdata() https://codex.wordpress.org/Function_Reference/get_userdata

    Or it returns an array that is constructed by using that information

    
    $value = array(
      'ID'        => $user_id,
      'user_firstname'  => $wp_user->user_firstname,
      'user_lastname'    => $wp_user->user_lastname,
      'nickname'      => $wp_user->nickname,
      'user_nicename'    => $wp_user->user_nicename,
      'display_name'    => $wp_user->display_name,
      'user_email'    => $wp_user->user_email,
      'user_url'      => $wp_user->user_url,
      'user_registered'  => $wp_user->user_registered,
      'user_description'  => $wp_user->user_description,
      'user_avatar'    => get_avatar( $user_id ),
    );
    

    And it returns either a single user or an array of users depending on the “Multiple” setting.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘User Field Documentation Missing’ is closed to new replies.