fix(user-center): connect certification workflow

This commit is contained in:
2026-07-28 14:17:18 +08:00
parent a7f3caec59
commit d3bf75fbea
13 changed files with 97 additions and 23 deletions
+4
View File
@@ -132,9 +132,13 @@ class AuthApply {
$desc = isset($_POST['desc']) ? sanitize_textarea_field(wp_unslash((string) $_POST['desc'])) : '';
$msg = isset($_POST['msg']) ? sanitize_textarea_field(wp_unslash((string) $_POST['msg'])) : '';
$type = isset($_POST['type']) ? sanitize_key((string) wp_unslash($_POST['type'])) : '';
$allowed_types = array_column((array) $s['types'], 'slug');
if ($name === '') {
wp_send_json(['error' => 1, 'msg' => __('请填写认证身份名称', 'aksrt')]);
}
if ($type === '' || !in_array($type, $allowed_types, true)) {
wp_send_json(['error' => 1, 'msg' => __('请选择有效的认证类型', 'aksrt')]);
}
$images = [];
if (!empty($_FILES['image']['name'])) {