refactor(settings): collapse get_all to aksrt_settings and drop migration UI

Make aksrt_settings the sole theme settings store for get_all(), remove
aksrt_seo_settings/aksrt_basic_settings merge paths, point global.logo
schema at aksrt_settings, and delete the retired settings migration page,
route, REST endpoint, and related SPA surface.
This commit is contained in:
2026-07-11 16:55:27 +08:00
parent b4da8cc1f4
commit 91b083b2b0
15 changed files with 16 additions and 471 deletions
+9 -15
View File
@@ -66,7 +66,7 @@ class AKSRT_Settings {
*/
public static function on_option_updated(string $option_name): void {
$tracked = array_merge(
['aksrt_settings', 'aksrt_basic_settings'],
['aksrt_settings'],
self::STANDALONE_OPTION_KEYS
);
@@ -95,19 +95,14 @@ class AKSRT_Settings {
return self::$cached_all;
}
// Canonical theme settings live only in aksrt_settings.
// Operational configs (captcha/moderation/oauth/footer/etc.) stay standalone.
$settings = get_option('aksrt_settings', []);
$seo = get_option('aksrt_seo_settings', []);
$basic = get_option('aksrt_basic_settings', []);
$merged = array_merge(
is_array($settings) ? $settings : [],
is_array($seo) ? $seo : [],
is_array($basic) ? $basic : []
);
if (!is_array($merged)) $merged = [];
self::$cached_all = $merged;
return $merged;
if (!is_array($settings)) {
$settings = [];
}
self::$cached_all = $settings;
return $settings;
}
/**
@@ -126,7 +121,6 @@ class AKSRT_Settings {
* 用于导入导出完整性检查。
*/
public const STANDALONE_OPTION_KEYS = [
'aksrt_seo_settings',
'aksrt_mail_smtp',
'aksrt_oauth',
'aksrt_captcha_config',
@@ -267,7 +261,7 @@ class AKSRT_Settings {
}
}
/** 启动时对齐原生 site_icon,兼容历史已保存的 SEO favicon。 */
/** 启动时对齐原生 site_icon,同步自定义 site_favicon 到原生 site_icon。 */
public static function maybe_sync_native_site_icon(): void {
$custom = self::custom_favicon_url();
if ($custom === '') {