绕过 wp-login 替换) */ public static function admin_sign_key(): string { return trim((string) self::get_value('admin_sign_key', '')); } /** 登录页 UI 配置数组 */ public static function sign_page_ui(): array { return [ 'background' => self::get_value('sign_page_background', []), 'theme_mode' => in_array((string) self::get_value('sign_theme_mode', 'default'), ['default', 'light', 'dark'], true) ? (string) self::get_value('sign_theme_mode', 'default') : 'default', 'show_header' => (bool) self::get_value('sign_show_header', true), 'card_position' => in_array((string) self::get_value('sign_card_position', 'center'), ['left', 'center', 'right'], true) ? (string) self::get_value('sign_card_position', 'center') : 'center', 'show_logo' => (bool) self::get_value('sign_show_logo', true), 'footer' => (string) self::get_value('sign_page_footer', ''), ]; } /** 弹窗 UI 配置数组 */ public static function modal_ui(): array { return [ 'background' => self::get_value('sign_modal_background', []), 'show_logo' => (bool) self::get_value('sign_modal_show_logo', true), ]; } /** 登录框日间 LOGO URL(空时回退全局 logo_url) */ public static function user_logo_url(): string { $ids = self::get_value('user_logo', []); if (is_array($ids) && !empty($ids)) { $url = wp_get_attachment_url((int) $ids[0]); if ($url) return $url; } return self::logo_url(); } /** 登录框夜间 LOGO URL(空时回退全局 logo_dark_url) */ public static function user_logo_dark_url(): string { $ids = self::get_value('user_logo_dark', []); if (is_array($ids) && !empty($ids)) { $url = wp_get_attachment_url((int) $ids[0]); if ($url) return $url; } return self::logo_dark_url(); } /** 是否允许手机号登录 */ public static function signin_phone_enabled(): bool { return (bool) self::get_value('user_signin_phone_s', false); } /** 免密登录显示模式 */ public static function nopas_active_mode(): string { $mode = (string) self::get_value('user_signin_nopas_active', 'nopas_first'); return in_array($mode, ['nopas_first', 'password_first', 'nopas_only'], true) ? $mode : 'nopas_first'; } /** 绑定提醒类型(兼容旧 bool 值:true→'phone',false→'close') */ public static function bind_reminder_type(): string { $val = self::get_value('bind_reminder', 'close'); if (is_bool($val)) return $val ? 'phone' : 'close'; $val = (string) $val; return in_array($val, ['email', 'phone', 'email_phone', 'close'], true) ? $val : 'close'; } /** 强制绑定类型(兼容旧 bool 值:true→'phone',false→'close') */ public static function mandatory_bind_type(): string { $val = self::get_value('mandatory_bind', 'close'); if (is_bool($val)) return $val ? 'phone' : 'close'; $val = (string) $val; return in_array($val, ['email', 'phone', 'email_phone', 'close'], true) ? $val : 'close'; } /** 昵称黑名单关键词数组 */ public static function nickname_blacklist(): array { $raw = (string) self::get_value('user_nickname_out', ''); if ($raw === '') return []; // 支持逗号分隔和换行分隔 $items = preg_split('/[,,\r\n]+/', $raw); return array_values(array_filter(array_map('trim', $items), 'strlen')); } /** 邮箱限制配置:['type' => 'black'|'white', 'domains' => [...]] */ public static function email_limit(): array { $type = (string) self::get_value('user_email_limit_type', 'black'); if (!in_array($type, ['black', 'white'], true)) $type = 'black'; $raw = (string) self::get_value('user_email_out', ''); $domains = []; if ($raw !== '') { $items = preg_split('/[\r\n]+/', $raw); $domains = array_values(array_filter(array_map('trim', $items), 'strlen')); } return ['type' => $type, 'domains' => $domains]; } /** 用户协议前台配置(enabled / required / page) */ public static function user_agreement_settings(): array { return [ 'enabled' => !isset(self::get_all()['user_agreement_s']) || !empty(self::get_value('user_agreement_s', true)), 'required' => !isset(self::get_all()['user_agreement_check']) || !empty(self::get_value('user_agreement_check', true)), 'page' => trim((string) self::get_value('user_agreement_page', '')), ]; } }