Short code to modify the user profile from the frontend

I am trying to pass a template that I found here to a short code to display on a page on the frontend.

Now now I have the following:

// profile action hook - catches form submission and acts accordingly add_action('init','profile_form_submission'); function profile_form_submission() {      /* Get user info. */     global $  current_user, $  wp_roles;     //get_currentuserinfo(); //deprecated since 3.1      /* Load the registration file. */     //require_once( ABSPATH . WPINC . '/registration.php' ); //deprecated since 3.1     $  error = array();         /* If profile was saved, update profile. */     if ( 'POST' == $  _SERVER['REQUEST_METHOD'] && !empty( $  _POST['action'] ) && $  _POST['action'] == 'update-user' ) {          /* Update user password. */         if ( !empty($  _POST['pass1'] ) && !empty( $  _POST['pass2'] ) ) {         if ( $  _POST['pass1'] == $  _POST['pass2'] )             wp_update_user( array( 'ID' => $  current_user->ID, 'user_pass' => esc_attr( $  _POST['pass1'] ) ) );         else             $  error[] = __('Las contraseñas no son iguales, por lo tanto, no fueron actualizadas.', 'profile');         }          /* Update user information. */         if ( !empty( $  _POST['url'] ) )         wp_update_user( array( 'ID' => $  current_user->ID, 'user_url' => esc_url( $  _POST['url'] ) ) );         if ( !empty( $  _POST['email'] ) ){         if (!is_email(esc_attr( $  _POST['email'] )))             $  error[] = __('Este email no es valido, pruebe otra vez.', 'profile');         elseif(email_exists(esc_attr( $  _POST['email'] )) != $  current_user->id )             $  error[] = __('Este email ya esta en uso por otro usuario, pruebe con otro.', 'profile');         else{             wp_update_user( array ('ID' => $  current_user->ID, 'user_email' => esc_attr( $  _POST['email'] )));         }         }           /* Redirect so the page will show updated info.*/       /*I am not Author of this Code- i dont know why but it worked for me after changing below line to if ( count($  error) == 0 ){ */         if ( count($  error) == 0 ) {         //action hook for plugins and extra fields saving         do_action('edit_user_profile_update', $  current_user->ID);         wp_redirect( get_permalink() );         exit;         }     } }  // shows login form (or a message, if user already logged in) function get_profile_customers_form($  redirect) {             if ( !is_user_logged_in() ) {         $  return = .__('Tienes que estar logueado para modificar esta pagina.', 'profile');             else {                 if ( count($  error) > 0 ) echo '<p class="error">' . implode("<br />", $  error) . '</p>';                 <form method="post" id="adduser" action="<?php the_permalink(); ?>">                     <p class="form-email">                         <label for="email"><?php _e('E-mail *', 'profile'); ?></label>                         <input class="text-input" name="email" type="text" id="email" value="<?php the_author_meta( 'user_email', $  current_user->ID ); ?>" />                     </p><!-- .form-email -->                     <p class="form-password">                         <label for="pass1"><?php _e('Contraseña *', 'profile'); ?> </label>                         <input class="text-input" name="pass1" type="password" id="pass1" />                     </p><!-- .form-password -->                     <p class="form-password">                         <label for="pass2"><?php _e('Confirmar *', 'profile'); ?></label>                         <input class="text-input" name="pass2" type="password" id="pass2" />                     </p><!-- .form-password -->                      <?php                          //action hook for plugin and extra fields                         do_action('edit_user_profile',$  current_user);                      ?>                     <p class="form-submit">                         <?php echo $  referer; ?>                         <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Actualizar cuenta', 'profile'); ?>" />                         <?php wp_nonce_field( 'update-user' ) ?>                         <input name="action" type="hidden" id="action" value="update-user" />                     </p><!-- .form-submit -->                 </form><!-- #adduser -->    }  // adds a handy [profile_form_submission] shortcode to use in posts/pages add_shortcode('profile_form_submission','profile_form_submission_shortcode'); function vr_login_shortcode ($  atts,$  content=false) {   $  atts = shortcode_atts(array(     'redirect' => home_url()   ), $  atts);   return get_profile_customers_form($  atts['redirect']); } 

I don’t know how to do the part of the code that the form shows. It is from "// shows login form (or a message, if user already logged in)".

The original code that I am trying to adapt was the following:

    <?php if ( !is_user_logged_in() ) : ?>             <p class="warning">                 <?php _e('Tienes que estar logueado para modificar esta pagina.', 'profile'); ?>             </p><!-- .warning -->     <?php else : ?>         <?php if ( count($  error) > 0 ) echo '<p class="error">' . implode("<br />", $  error) . '</p>'; ?>         <form method="post" id="adduser" action="<?php the_permalink(); ?>">             <p class="form-email">                 <label for="email"><?php _e('E-mail *', '<br />', 'profile'); ?></label>                 <input class="text-input" name="email" type="text" id="email" value="<?php the_author_meta( 'user_email', $  current_user->ID ); ?>" />             </p><!-- .form-email -->             <p class="form-password">                 <label for="pass1"><?php _e('Contraseña *',"<br>", 'profile'); ?> </label>                 <input class="text-input" name="pass1" type="password" id="pass1" />             </p><!-- .form-password -->             <p class="form-password">                 <label for="pass2"><?php _e('Confirmar *',"<br>", 'profile'); ?></label>                 <input class="text-input" name="pass2" type="password" id="pass2" />             </p><!-- .form-password -->              <?php                  //action hook for plugin and extra fields                 do_action('edit_user_profile',$  current_user);              ?>             <p class="form-submit">                 <?php echo $  referer; ?>                 <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Actualizar cuenta', 'profile'); ?>" />                 <?php wp_nonce_field( 'update-user' ) ?>                 <input name="action" type="hidden" id="action" value="update-user" />             </p><!-- .form-submit -->         </form><!-- #adduser -->