Front-End-Image-Upload

Ich habe den folgenden Code oben auf meiner Frontend-Benutzerprofilseite verwendet, alles funktioniert einwandfrei und zeigt bis auf das folgende Problem an ….

Wenn ich ein Bild hochlade und das Formular usermeta ‘profile-image’ richtig übermittle, aber wenn ich das Formular uploade, wird dieses Meta gelöscht und es sieht so aus als ob der update_usermeta Aufruf immer noch ausgetriggers wird und leer gemacht wird.

Nicht sicher, was ich falsch mache, macht mich verrückt

 $current_user->ID, 'user_pass' => esc_attr( $_POST['pass1'] ) ) ); else $error[] = __('The passwords you entered do not match. Your password was not updated.', 'profile'); } update_usermeta( $current_user->ID, $_POST['country'] ); update_usermeta( $current_user->ID, $_POST['identity'] ); update_usermeta( $current_user->ID, $_POST['workplace'] ); update_usermeta( $current_user->ID, $_POST['public_email'] ); $bio_summary = sanitize_text_field($_POST['bio-summary']); update_usermeta( $current_user->ID, 'bio_summary', $bio_summary ); $web_link = esc_url_raw($_POST['web-link'], array('http', 'https')); update_usermeta( $current_user->ID, 'web_link', $web_link ); $bio_longer = sanitize_text_field($_POST['bio-longer']); update_usermeta( $current_user->ID, 'bio_longer', $bio_longer ); if ( count($error) == 0 ) { do_action('edit_user_profile_update', $current_user->ID); //wp_redirect( get_permalink() ); } } ?> ID, 'profile_image', $attach_url ); } else { echo 'Upload error'; } ?> 

Dies ist die Form ….

  
ID ); ?>
<input type="text" id="profile-image-set" name="profile-image-set" value="ID ) ); ?>" class="regular-text" />
ID ); ?> <option value="not specified" >Not Specified <option value="australia" >Australia <option value="bangladesh" >Bangladesh <option value="bhutan" >Bhutan <option value="brunei" >Brunei <option value="cambodia" >Cambodia <option value="canada" >Canada <option value="china" >China <option value="fiji" >Fiji <option value="hong kong" >Hong Kong <option value="india" >India <option value="indonesia" >Indonesia <option value="japan" >Japan <option value="korea" >Korea <option value="laos" >Laos <option value="malaysia" >Malaysia <option value="nepal" >Nepal <option value="new zealand" >New Zealand <option value="myanmar" >Myanmar <option value="singapore" >Singapore <option value="philippines" >Philippines <option value="sri lanka" >Sri Lanka <option value="taiwan" >Taiwan <option value="thailand" >Thailand <option value="tibet" >Tibet <option value="vietnam" >Vietnam <option value="united kingdom" >United Kingdom <option value="united states" >United States <option value="other" >Other
ID ); ?> <option value="not specified" >Not Specified <option value="writer" >Writer <option value="translator" >Translator <option value="publisher" >Publisher <option value="festival organiser" >Festival Organiser <option value="student" >Student <option value="literary agent" >Literary Agent <option value="academic" >Academic <option value="other" >Other
ID ); ?> <option value="not specified" >Not Specified <option value="university" >University <option value="school" >School <option value="literary organisation" >Literary Organisation <option value="writers circle" >Writers' Circle <option value="other" >Other
<input type="text" name="web-link" id="web-link" value="ID ) ); ?>" class="regular-text" />
<input type="checkbox" name="public_email" id="public_email" value="yes" />

<input name="updateuser" type="submit" id="updateuser" class="submit button" value="" />

Vielen Dank

John

Solutions Collecting From Web of "Front-End-Image-Upload"