feat(modal): add rollout telemetry foundation

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-08-04 21:23:04 +08:00
1 parent 8b728295a9
commit 113a6bcab0
14 files changed
+320 -1

No files matched your search

+9
View File
@@ -178,4 +178,13 @@ trait DomainGroups {
public static function get_system_tools_settings(): array {
return Capabilities::get_system_tools_settings();
}
/**
* 获取前台弹窗按领域灰度开关。
*
* @return array{identity:bool,badges:bool,orders:bool,vip:bool}
*/
public static function get_frontend_modal_rollout_settings(): array {
return ModalRuntime::get_frontend_modal_rollout_settings();
}
}
+29
View File
@@ -0,0 +1,29 @@
<?php
/**
* Frontend modal runtime settings.
*
* @package AKSRT
*/
namespace AKSRT\Settings;
defined('ABSPATH') || exit;
class ModalRuntime {
/**
* Read the per-domain frontend modal rollout switches.
*
* @return array{identity:bool,badges:bool,orders:bool,vip:bool}
*/
public static function get_frontend_modal_rollout_settings(): array {
$settings = Settings::get_all();
return [
'identity' => !empty($settings['frontend_modal_rollout_identity']),
'badges' => !empty($settings['frontend_modal_rollout_badges']),
'orders' => !empty($settings['frontend_modal_rollout_orders']),
'vip' => !empty($settings['frontend_modal_rollout_vip']),
];
}
}