On this page
function template_preprocess_user_profile
template_preprocess_user_profile(&$variables)
Process variables for user-profile.tpl.php.
Parameters
array $variables: An associative array containing:
- elements: An associative array containing the user information and any fields attached to the user. Properties used:
- #account: The user account of the profile being viewed.
See also
File
- modules/user/user.pages.inc, line 227
- User page callback file for the user module.
Code
function template_preprocess_user_profile(&$variables) {
$account = $variables['elements']['#account'];
// Helpful $user_profile variable for templates.
foreach (element_children($variables['elements']) as $key) {
$variables['user_profile'][$key] = $variables['elements'][$key];
}
// Preprocess fields.
field_attach_preprocess('user', $account, $variables['elements'], $variables);
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!user!user.pages.inc/function/template_preprocess_user_profile/7.x