ID, 'king_addons_social_provider', true); if (!empty($social_provider)) { $provider_id = get_user_meta($user->ID, 'king_addons_social_provider_id', true); $social_picture = get_user_meta($user->ID, 'king_addons_social_picture', true); ?> ID); if (!empty($custom_fields)) { foreach ($custom_fields as $meta_key => $field_data) { $field_label = $field_data['label']; $field_value = $field_data['value']; ?>

Profile


$field_data) { if (isset($_POST[$meta_key])) { $sanitized_value = sanitize_textarea_field($_POST[$meta_key]); update_user_meta($user_id, $meta_key, $sanitized_value); } } } } /** * Get King Addons custom fields for a user */ private static function get_king_addons_custom_fields($user_id) { $custom_fields = []; $all_meta = get_user_meta($user_id); foreach ($all_meta as $meta_key => $meta_value) { // Check if it's a King Addons custom field (but not a label) if (strpos($meta_key, 'king_addons_custom_field_') === 0 && strpos($meta_key, '_label') === false) { $field_value = is_array($meta_value) && count($meta_value) === 1 ? $meta_value[0] : $meta_value; // Try to get the field label $label_key = $meta_key . '_label'; $field_label = get_user_meta($user_id, $label_key, true); $custom_fields[$meta_key] = [ 'value' => $field_value, 'label' => !empty($field_label) ? $field_label : ucwords(str_replace(['king_addons_custom_field_', '_'], ['', ' '], $meta_key)) ]; } } return $custom_fields; } }