'string', 'sanitize_callback' => static fn($value) => $value === 'http' ? 'http' : 'mock', 'default' => 'mock', ]); register_setting('spp_settings', 'spp_proxmox_base_url', ['type' => 'string', 'sanitize_callback' => 'esc_url_raw']); register_setting('spp_settings', 'spp_proxmox_token_id', ['type' => 'string', 'sanitize_callback' => 'sanitize_text_field']); register_setting('spp_settings', 'spp_proxmox_token_secret', ['type' => 'string', 'sanitize_callback' => 'sanitize_text_field']); register_setting('spp_settings', 'spp_proxmox_node', ['type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'default' => 'pve-01']); register_setting('spp_settings', 'spp_quota_user_memory_mb', [ 'type' => 'integer', 'sanitize_callback' => static fn($value) => max(0, absint($value)), 'default' => 0, ]); register_setting('spp_settings', 'spp_quota_global_memory_mb', [ 'type' => 'integer', 'sanitize_callback' => static fn($value) => max(0, absint($value)), 'default' => 0, ]); } public function enqueue_assets(string $hook): void { if ($hook !== 'toplevel_page_support-provisioning-portal') { return; } wp_enqueue_style('spp-portal', SPP_PLUGIN_URL . 'assets/portal.css', [], SPP_VERSION); wp_enqueue_script('spp-portal', SPP_PLUGIN_URL . 'assets/portal.js', [], SPP_VERSION, true); } public function render(): void { if (!current_user_can('edit_posts')) { wp_die(esc_html__('You do not have permission to access this page.', 'support-provisioning-portal')); } ?>