Changeset 4534 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php
- Timestamp:
- 12/15/2016 06:33:13 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php
r4470 r4534 38 38 39 39 $user_id = wpmu_create_user( wp_slash( $user_login ), wp_generate_password(), wp_slash( $user_email ) ); 40 if ( ! $user_id || is_wp_error( $user_id )) {40 if ( ! $user_id ) { 41 41 wp_die( __( 'Error! Something went wrong with your registration. Try again?', 'wporg-login' ) ); 42 42 } … … 79 79 die(); 80 80 } 81 82 function wporg_login_save_profile_fields() { 83 if ( ! $_POST || empty( $_POST['user_fields'] ) ) { 84 return; 85 } 86 $fields = array( 'url', 'from', 'occ', 'interests' ); 87 88 foreach ( $fields as $field ) { 89 if ( isset( $_POST['user_fields'][ $field ] ) ) { 90 $value = sanitize_text_field( wp_unslash( $_POST['user_fields'][ $field ] ) ); 91 if ( 'url' == $field ) { 92 wp_update_user( array( 93 'ID' => get_current_user_id(), 94 'user_url' => esc_url_raw( $value ) 95 ) ); 96 } else { 97 update_user_meta( $user->ID, $field, $value ); 98 } 99 } 100 } 101 }
Note: See TracChangeset
for help on using the changeset viewer.