Skip to content

Instantly share code, notes, and snippets.

@Taiger
Created May 19, 2014 16:38
Show Gist options
  • Save Taiger/234e69275f3104915e4b to your computer and use it in GitHub Desktop.
Save Taiger/234e69275f3104915e4b to your computer and use it in GitHub Desktop.
Print or render Drupal user account profile form anywhere
$account = user_load(UID);
module_load_include('inc', 'user', 'user.pages');
$form_state = array();
$form_state['build_info']['args'] = array($account);
form_load_include($form_state, 'inc', 'user', 'user.pages');
print render(drupal_build_form('user_profile_form', $form_state));
@Taiger
Copy link
Author

Taiger commented May 19, 2014

Someone said: you should call drupal_get_form and not drupal_build_form
no need for form_load_include

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment