get_results("SELECT * FROM {$wpdb->prefix}ace_register_fields ORDER BY sortby ASC"); $success = ''; $errors = []; require_once plugin_dir_path(__FILE__) . 'countries.php'; if ($_SERVER['REQUEST_METHOD'] === 'POST') { // PROFILE IMAGE UPLOAD if (!empty($_POST['update_profile']) && check_admin_referer('ace_update_profile')) { handle_profile_image_upload($current_user->ID, $_FILES['profile_img'], $errors, $success); // Save custom fields $sanitized = Ace_User_Management_Function::sanitize($_POST); $meta_fields = array_combine( array_map(fn($k) => $k . '_', array_keys($sanitized)), $sanitized ); if (update_user_meta($current_user->ID, 'user_extrafields', $meta_fields)) { foreach ($sanitized as $key => $val) { update_user_meta($current_user->ID, $key, sanitize_text_field($val)); } $success .= "