Support

Account

Home Forums General Issues Get an ACF User Field for logged in user in the "Default Value" of another Field Reply To: Get an ACF User Field for logged in user in the "Default Value" of another Field

  • See acf/prepare_field. Using this filter you can set the default value of a field from the field on the user page.

    
    add_filter('acf/prepare_field/name=your_field_name', 'default_user_company', 20);
    function default_user_company($field) {
      $field['defualt_value'] = get_field('company_name', 'user_'.get_current_user_id());
      return $field;
    }