create a custom form based on user fields I created  new menu item witch I want to insert a custom form to edit some user fields : 

$items['user/%user/edit-custom'] = array(
        'title' =&gt; 'Knowladge',
        'page callback' =&gt; 'drupal_get_form',
        'page arguments' =&gt; array('user_profile_form_custom', 1),
        'access callback' =&gt; 'user_edit_access',
        'access arguments' =&gt; array(1),
        'type' =&gt; MENU_LOCAL_TASK,
    );
    return $items;


Then the custom function that return the form : 

function user_profile_form_custom(){
    module_load_include('inc', 'user', 'user.pages');

    global $user;  
    $user = user_load($user-&gt;uid);

    $form = drupal_get_form('user_profile_form', $user, 'account', 'custom'); 

    return $form;
}


When visiting "user/%user/edit-custom" page I can see the profile page, then with some logic code in hook_form_alter I can hide some fields and show up only needed fields...

But the problem that I can't save the form, I get this error : 


  Fatal error: Call to undefined function user_profile_form_validate()
  in path_to_drupal/includes/form.inc on line 1514


this solution is inspired from answers described in this post .

Have you any idea please how to solve this, or if you have another way to get some user fields, edit them in a custom page, and save the changes.

Thanks in advance.
Is it possible you missed the comment (below)? It's on the post you linked to.


  "module_load_include('inc', 'user', 'user.pages'); should be added to hook_init() otherwise all profile form functionalities that require AJAX calls will return the error 'Call to undefined function user_profile_form_validate().'"