2024-03-08 21:48:15 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace WenPai\ChinaYes;
|
|
|
|
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
|
|
|
|
// 获取插件设置
|
|
|
|
function get_settings() {
|
2025-09-27 01:38:32 +08:00
|
|
|
static $cached_settings = null;
|
|
|
|
|
|
|
|
if ($cached_settings === null) {
|
|
|
|
$settings = is_multisite() ? get_site_option( 'wp_china_yes' ) : get_option( 'wp_china_yes' );
|
|
|
|
$cached_settings = wp_parse_args( $settings, [
|
2024-09-25 16:45:48 +08:00
|
|
|
'store' => 'wenpai',
|
2025-09-27 01:38:32 +08:00
|
|
|
'bridge' => true,
|
|
|
|
'arkpress' => false,
|
2024-09-25 16:45:48 +08:00
|
|
|
'admincdn' => [ 'admin' ],
|
2025-09-27 01:38:32 +08:00
|
|
|
'admincdn_public' => [ 'googlefonts' ],
|
|
|
|
'admincdn_files' => [ 'admin', 'emoji' ],
|
|
|
|
'admincdn_dev' => [ 'jquery' ],
|
|
|
|
'admincdn_version_enable' => false,
|
|
|
|
'admincdn_version' => [ 'css', 'js', 'timestamp' ],
|
2024-09-25 16:45:48 +08:00
|
|
|
'cravatar' => 'cn',
|
|
|
|
'windfonts' => 'off',
|
2025-09-27 01:38:32 +08:00
|
|
|
'windfonts_list' => [
|
|
|
|
[
|
|
|
|
'family' => 'cszt',
|
|
|
|
'subset' => 'regular',
|
|
|
|
'lang' => '',
|
|
|
|
'weight' => 400,
|
|
|
|
'style' => 'normal',
|
|
|
|
'selector' => 'a:not([class]),p,h1,h2,h3,h4,h5,h6,ul,ol,li,button,blockquote,pre,code,table,th,td,label,b,i:not([class]),em,small,strong,sub,sup,ins,del,mark,abbr,dfn,span:not([class])',
|
|
|
|
'enable' => true,
|
|
|
|
]
|
|
|
|
],
|
|
|
|
'windfonts_typography_cn' => [],
|
|
|
|
'windfonts_typography_en' => [],
|
|
|
|
'windfonts_reading_enable' => false,
|
|
|
|
'windfonts_reading' => 'off',
|
|
|
|
'motucloud' => 'off',
|
|
|
|
'fewmail' => 'off',
|
|
|
|
'comments_enable' => false,
|
|
|
|
'comments_role_badge' => true,
|
|
|
|
'comments_remove_website' => false,
|
|
|
|
'comments_validation' => true,
|
|
|
|
'comments_herp_derp' => false,
|
|
|
|
'comments_sticky_moderate' => false,
|
|
|
|
'wordyeah' => 'off',
|
|
|
|
'bisheng' => 'off',
|
|
|
|
'deerlogin' => 'off',
|
|
|
|
'waimao' => 'off',
|
|
|
|
'waimao_enable' => false,
|
|
|
|
'waimao_language_split' => false,
|
|
|
|
'waimao_admin_language' => 'zh_CN',
|
|
|
|
'waimao_frontend_language' => 'en_US',
|
|
|
|
'waimao_auto_detect' => false,
|
|
|
|
'woocn' => 'off',
|
|
|
|
'lelms' => 'off',
|
|
|
|
'wapuu' => 'off',
|
2024-09-25 16:45:48 +08:00
|
|
|
'adblock' => 'off',
|
|
|
|
'adblock_rule' => [],
|
|
|
|
'plane' => 'off',
|
|
|
|
'plane_rule' => [],
|
|
|
|
'monitor' => true,
|
2025-01-02 10:36:40 +08:00
|
|
|
'memory' => true,
|
2024-09-25 16:45:48 +08:00
|
|
|
'hide' => false,
|
|
|
|
'custom_name' => 'WP-China-Yes',
|
2025-09-27 01:38:32 +08:00
|
|
|
'enabled_sections' => [ 'welcome', 'store', 'admincdn', 'cravatar', 'other', 'about' ],
|
|
|
|
'wp_memory_limit' => '256M',
|
|
|
|
'wp_max_memory_limit' => '512M',
|
|
|
|
'wp_post_revisions' => 5,
|
|
|
|
'autosave_interval' => 300,
|
|
|
|
'custom_rss_url' => '',
|
|
|
|
'custom_rss_refresh' => 3600,
|
|
|
|
'rss_display_options' => [ 'show_date', 'show_summary', 'show_footer' ],
|
|
|
|
] );
|
|
|
|
}
|
|
|
|
|
|
|
|
return $cached_settings;
|
|
|
|
}
|
|
|
|
|
|
|
|
function clear_settings_cache() {
|
|
|
|
static $cached_settings = null;
|
|
|
|
$cached_settings = null;
|
2024-03-08 21:48:15 +08:00
|
|
|
}
|