Merge pull request 'fix(settings): restore memo cache dropped in class split' (#194) from fix/settings-cached-all into main
Reviewed-on: CYL/wordpress-theme-aksrt#194
This commit is contained in:
@@ -19,7 +19,42 @@ class Settings {
|
|||||||
private static $instance = null;
|
private static $instance = null;
|
||||||
use FacadeBulk;
|
use FacadeBulk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Per-request memoization of merged settings.
|
||||||
|
*
|
||||||
|
* 同一请求内多次调用 get_all() 仅读 1 次 option。
|
||||||
|
* 后端写入 option 时通过 updated_option hook 失效。
|
||||||
|
*
|
||||||
|
* @var array|null
|
||||||
|
*/
|
||||||
|
private static $cached_all = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有独立 option key(非 aksrt_settings)。
|
||||||
|
* 用于导入导出完整性检查。
|
||||||
|
*/
|
||||||
|
public const STANDALONE_OPTION_KEYS = [
|
||||||
|
'aksrt_mail_smtp',
|
||||||
|
'aksrt_oauth',
|
||||||
|
'aksrt_captcha_config',
|
||||||
|
'aksrt_moderation_config',
|
||||||
|
'aksrt_footer_settings',
|
||||||
|
'aksrt_footer_tabbar',
|
||||||
|
'aksrt_floating_buttons',
|
||||||
|
'aksrt_credit_settings',
|
||||||
|
'aksrt_notification_settings',
|
||||||
|
'aksrt_friend_links',
|
||||||
|
'aksrt_banners',
|
||||||
|
'aksrt_category_recommend',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 包含 secret 字段的 option key — 空值保留旧值策略。
|
||||||
|
*/
|
||||||
|
public const SECRET_OPTION_KEYS = [
|
||||||
|
'aksrt_mail_smtp',
|
||||||
|
'aksrt_oauth',
|
||||||
|
];
|
||||||
|
|
||||||
private function __construct() {}
|
private function __construct() {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user