/**
 * Get the registered pages
 * 
 * @return array
 * @since 1.2
 */
function get_registration_pages()
{
    return registration_page();
}
/**
 * Function is responsible for managing the user registrations
 * 
 * @return string
 */
function bum_init_page_registration()
{
    global $wp_roles;
    //reasons to return
    if (!bum_is_page('Registration')) {
        return false;
    }
    foreach ($wp_roles->roles as $slug => $role) {
        if ($role['register'] == 'yes') {
            registration_page(array('role' => $slug, 'name' => $role['name'], 'redirect_to' => get_bloginfo('url') . '/profile/', 'fields' => array('user_login', 'user_email'), 'force_login' => false));
        }
    }
    if (is_user_logged_in()) {
        wp_redirect(bum_get_permalink_profile());
        exit;
    }
    //initializing
    global $bum_errors;
    if (!empty($_POST)) {
        $role = bum_get_registration_type();
        $bum_errors = bum_register_new_user($_POST['user_login'], $_POST['user_email'], $_POST['user_type']);
        if ((string) (int) $bum_errors == $bum_errors) {
            bum_save_user_meta_data($bum_errors);
        }
    }
}