Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
62 lines
2.0 KiB
PHP
62 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace {
|
|
define('ABSPATH', __DIR__ . '/');
|
|
|
|
function __(string $text, string $domain = ''): string { return $text; }
|
|
function esc_html($value): string { return (string) $value; }
|
|
function esc_html__($value, string $domain = ''): string { return (string) $value; }
|
|
function esc_attr($value): string { return (string) $value; }
|
|
function esc_attr__($value, string $domain = ''): string { return (string) $value; }
|
|
function esc_url($value): string { return (string) $value; }
|
|
function wp_kses_post($value): string { return (string) $value; }
|
|
function aksrt_get_user_center_tab_url(string $tab): string { return '/user/' . $tab; }
|
|
}
|
|
|
|
namespace AKSRT\Settings {
|
|
final class Settings {
|
|
public static function credits_enabled(): bool { return true; }
|
|
}
|
|
}
|
|
|
|
namespace {
|
|
require dirname(__DIR__, 2) . '/src/Content/VipServiceModal.php';
|
|
|
|
final class VipPointsDescriptionProbe {
|
|
use \AKSRT\Content\VipServiceModal;
|
|
|
|
/** @return array<string,mixed> */
|
|
private function get_vip_settings_context(): array {
|
|
return [
|
|
'enabled' => true,
|
|
'levels' => [1 => ['enabled' => true, 'name' => 'VIP1']],
|
|
'points_exchange' => [
|
|
'enabled' => true,
|
|
'desc' => '<p>后台配置的兑换说明</p>',
|
|
],
|
|
];
|
|
}
|
|
|
|
/** @return array<string,mixed> */
|
|
public function get_catalog(int $user_id = 0): array {
|
|
return [
|
|
'points_exchange' => [
|
|
'packages' => [[
|
|
'package_id' => 6001,
|
|
'level' => 1,
|
|
'points' => 500,
|
|
'time' => 30,
|
|
'unit' => 'day',
|
|
]],
|
|
],
|
|
'user_points' => 1000,
|
|
'currency_name' => '积分',
|
|
];
|
|
}
|
|
}
|
|
|
|
echo (new VipPointsDescriptionProbe())->get_points_exchange_modal_html(1);
|
|
}
|