Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
if (!$modx->user->hasSessionContext($modx->context->get('key')) return '';
$userArray = $modx->user->toArray();
$profile = $modx->user->getOne('Profile');
if ($profile) {
$userArray = array_merge($profile->toArray(),$userArray);
$extended = $profile->get('extended');
if (!empty($extended) && is_array($extended)) {
$userArray = array_merge($extended,$userArray);
}
}
$hook->setValues($userArray);
return true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.