I have about 3 profile types each with their own registration path. But there's one without a path. I want to attach this to the main registration form. So that it shows when adding user on the main user add page but not other pages.
i got it to show with the code below but error when saving the user.
Recoverable fatal error: Argument 1 passed to profile2_save() must be an instance of Profile, instance of ProfileType given,, called in C://....
function short_fixes_form_user_register_form_alter(&$form, &$form_state) { global $user; $current_user_role = in_array('family',$user->roles); $form['account']['status']['#access'] = FALSE ; if($_GET['q'] == 'admin/people/create' && $current_user_role){ $form_state['profiles'] = array( 'family' => profile2_get_types('family') ); profile2_attach_form($form, $form_state); } }