I have a menu router with type MENU_CALLBACK and it's 'page callback' property points to a function that implements render API, as follow:
/** Implements hook_menu **/
function custom_render_menu() {
$items['register-profile'] = array(
'page callback' => 'custom_render_register_profile',
'type' => MENU_CALLBACK,
);
return $items;
}
/** Implements callback page for register-profile **/
function custom_render_register_profile() {
$user_register_form = drupal_get_form('user_registration_form');
$markup = user_is_logged_in() ? t("Alternative Content") : drupal_render($user_register_form);
$output = array( '#markup' => $markup);
return $output;
}
If the user is not logged in, the registration form displays correctly, but if the user is logged in, the page was redirected to user/uid router, showing user's profile. How can I display an alternative content instead of redirecting the user to their user page?