false, 'allow_apply' => false]; $status = $user_id > 0 && class_exists(AuthApply::class) ? AuthApply::get_status($user_id) : ''; $info = $user_id > 0 && class_exists(AuthApply::class) ? AuthApply::get_auth_info($user_id) : []; $apply = $user_id > 0 && class_exists(AuthApply::class) ? AuthApply::get_apply_payload($user_id) : []; $reason = $user_id > 0 && class_exists(AuthApply::class) ? (string) get_user_meta($user_id, AuthApply::REASON_META, true) : ''; $evidence = class_exists(AuthApply::class) ? AuthApply::get_evidence_items($apply, $user_id) : []; $type_labels = []; foreach ((array) ($settings['types'] ?? []) as $type) { $type_labels[(string) ($type['slug'] ?? '')] = (string) ($type['label'] ?? ''); } $apply_type = sanitize_key((string) ($apply['type'] ?? '')); $limit = (int) ($settings['limit_level'] ?? 0); $current_level = class_exists('\AKSRT\User\Level') ? (int) \AKSRT\User\Level::get_level($user_id) : 0; $blocked_level = $limit > 0 && $current_level < $limit; $can_apply = !empty($settings['enabled']) && !empty($settings['allow_apply']) && !$blocked_level && $status !== 'verified'; ?>