'', 'dc' => Consts::DATA_CENTER_AMS, 'debug' => false, ); $opts = get_option(Settings::OPTION_NAME, array()); $opts = is_array($opts) ? $opts : array(); $opts = wp_parse_args($opts, $defaults); $opts['debug'] = !empty($opts['debug']); return $opts; } /** * Save options by patching current set. * * @param array $patch */ public static function save(array $patch): void { $current = self::get(); $merged = array_merge($current, $patch); update_option(Settings::OPTION_NAME, $merged); } public static function isOnboarded(): bool { $flag = (bool) get_option(Config::ONBOARDED_FLAG, false); if ($flag) { return true; } $opts = self::get(); return !empty($opts['tagging_hash']); } public static function setOnboarded(bool $yes = true): void { update_option(Config::ONBOARDED_FLAG, $yes); } }