$field ) {
// If this is not an excluded meta field.
if ( ! in_array( $meta, $exclude ) ) {
// If the field is user editable.
if ( $field['register']
&& $field['type'] != 'password'
&& $field['type'] != 'file'
&& $field['type'] != 'image'
&& ! $field['native'] ) {
// Check for required fields.
$chk = '';
if ( ! $field['required'] ) {
$chk = 'ok';
}
if ( $field['required'] && $_POST[ $meta ] != '' ) {
$chk = 'ok';
}
// Check for field value.
if ( $field['type'] == 'multiselect' || $field['type'] == 'multicheckbox' ) {
$field_val = ( isset( $_POST[ $meta ] ) ) ? implode( '|', $_POST[ $meta ] ) : '';
} else {
$field_val = ( isset( $_POST[ $meta ] ) ) ? $_POST[ $meta ] : '';
}
if ( $chk == 'ok' ) {
update_user_meta( $user_id, $meta, $field_val );
}
}
}
}
}
// End of file.