false, 'allow_apply' => false]; $status = class_exists(AuthApply::class) ? AuthApply::get_status($user_id) : ''; $info = class_exists(AuthApply::class) ? AuthApply::get_auth_info($user_id) : []; $apply = class_exists(AuthApply::class) ? AuthApply::get_apply_payload($user_id) : []; $record = is_array($apply['_application'] ?? null) ? $apply['_application'] : []; $stage = sanitize_key((string) ($record['status'] ?? '')); $locks_application = in_array($stage, ['created', 'provider_pending', 'provider_processing', 'manual_pending'], true); $reason = (string) ($record['review_note'] ?? $record['provider_result_summary'] ?? ''); $can_apply = !empty($settings['enabled']) && !empty($settings['allow_apply']) && $status !== 'verified'; $config = [ 'restBase' => untrailingslashit(rest_url('aksrt/v1/identity/applications')), 'nonce' => wp_create_nonce('wp_rest'), 'currentUuid' => $locks_application ? (string) ($record['application_uuid'] ?? '') : '', 'currentStage' => $locks_application ? $stage : '', 'provider' => sanitize_key((string) ($settings['provider'] ?? 'aliyun')), 'allowManual' => !empty($settings['allow_manual_fallback']), ]; ?>