0 ) ){ //update user profile here $userid = $_GET['uid']; $firstname = isset( $_POST['firstname'] ) ? trim( esc_html ( $_POST['firstname'] ) ) : ""; $lastname = isset( $_POST['lastname'] ) ? trim( esc_html ( $_POST['lastname'] ) ) : ""; $email = isset( $_POST['email'] ) ? trim( esc_html ( $_POST['email'] ) ) : ""; $photo = isset( $_POST['user_photo'] ) ? esc_html( $_POST['user_photo'] ): ""; //this can cause header already sent error //echo htmlspecialchars_decode ( stripslashes( $photo ) ); $password1 = isset( $_POST['password1'] ) ? $_POST['password1'] : ''; $password2 = isset( $_POST['password2'] ) ? $_POST['password2'] : ''; $data = array(); $data['ID'] = $userid; $data['user_email'] = $email; $check_pwd = user_profile_validate_password( $password1, $password2 ); if ( $check_pwd == "valid" ){ $data['user_pass'] = $password1; }else{ $error .= $check_pwd; } if( $firstname == "" ){ $error .= "

First name is required.

"; } if( $lastname == "" ){ $error .= "

Last name is required.

"; } //validate primary email $error .= user_profile_validate_email( $email ); //if no error, update if ( $error == "" ){ wp_update_user( $data ); update_user_meta( $userid, 'user_photo', $photo ); update_user_meta( $userid, 'first_name', $firstname ); update_user_meta( $userid, 'last_name', $lastname ); }else{ $error = '
'. $error .'
'; } } //put custom page template show_update_profile_action( $error ); exit; } } add_action('wp_head', 'wordpress_custom_profile_script'); function wordpress_custom_profile_script(){ $user_profile_page = get_option('user_profile_page'); if ( is_page( $user_profile_page ) ){ ?>