1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Custom User Field Callback - Get User

Discussion in 'XenForo Development Discussions' started by SirWill, Jan 26, 2016.

  1. SirWill

    SirWill Member


    how can I get the actual user/user_id in a php callback from the affected user?
    There is the $visitor variable which works in /account but not in the ACP as it gives the viewing user and not the user who gets edited.
  2. Chris D

    Chris D XenForo Developer Staff Member

    The only callback available to user fields is the validation callback. This is designed to verify a valid value is entered and it is not aware of anything other than the field and the value being entered. As such, it's impossible to know which user the value is being applied to.
  3. SirWill

    SirWill Member

    Okay, if there is no way to get the user then I have to use $visitor and ignore the validate in the ACP as workaround.

Share This Page