chore(branding): remove leftover upstream theme identifiers

The theme was renamed Zibll/子比 → AKSRT → Jio, but upstream branding
survived the sweeps in CSS classes, the SVG sprite prefix, a persisted
widget field ID, JS events, admin Vue class names, test infrastructure
and docblocks.

Renames:
- zib-widget / zib-widget-wrap / zib-slider → jio-widget-box /
  jio-widget-box-wrap / jio-slider-box (jio-widget is taken by the modern
  widget shell, jio-box-* by the card primitives)
- zib-partners-scroll + zps-* → jio-partners-scroll + jps-*
- zib-combo-info-card + zci-* → jio-combo-info-card + jci-*
- zibsvg- → jiosvg-, including the exported picker helpers and the
  fa-zibsvg- family-prefix guard
- zibpay_type → pay_type; the dual-read fallback in PostQuery collapses
  to a single key
- [zibajax="submit"] dropped (no PHP emitter); zib_ajax.success →
  jio_ajax.success
- aks-* admin Vue classes → jio-*
- zib_palette() → palette()

User-facing vendor traces are gone: the floating "more" button default no
longer ships a zibll.com link or 子比主题 marketing copy, the notice
widget ships no preset promo entries, and the four 官网教程 links are
removed from the post-list admin schema.

Test infrastructure renamed to neutral names (docker-compose.reference.yml,
Caddyfile, article-baseline.json, modern-widgets-contract.test.cjs) with
their DB/volume/env/slug identifiers following.

Kept intentionally, documented in tests/fixtures/README.md: the golden
fixture reference fingerprint (a SHA-256 record of an external directory,
read by validate-widget-golden / generate-widget-golden-fixture /
audit-widget-system), the doesNotMatch guards that prove the old tokens are
gone, and the reference theme's own meta key in the visual fixtures.

No backward-compat or data migration: saved widget configs holding old
icon keys or the old field ID silently lose them, per the project's
rewrite-over-compatibility rule.

Verified: 132/132 node contract tests, php tests/widget-system/run.php
(146 assertions), audit-admin-contracts, audit-psr4-paths and
validate-widget-golden all green; tracked bundles regenerated and in sync.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Opus 5 committed 2026-11-02 00:06:54 +08:00
1 parent 42cc64106d
commit 427968a721
188 files changed
+915 -967

No files matched your search

+4 -5
View File
@@ -2,9 +2,8 @@
/**
* Comment sprite icons — <use> references into the runtime svg-icon sprite.
*
* Mirrors zib_get_svg() from the reference comments module. Symbol
* definitions are injected by assets/js/runtime/svg-icon.js, which the
* vendor runtime lazy-loads on every page (main.js: tbquire(['svg-icon'])).
* Symbol definitions are injected by assets/js/runtime/svg-icon.js, which the
* runtime lazy-loads on every page (main.js: tbquire(['svg-icon'])).
*
* @package Jio
*/
@@ -13,13 +12,13 @@ defined('ABSPATH') || exit;
if (!function_exists('jio_get_comment_icon')) :
/**
* Sprite-referenced SVG icon (legacy: zib_get_svg).
* Sprite-referenced SVG icon.
*
* @param string $name Sprite key (like / topping / approve / menu_2 / signup).
* @param string $class Classes for the svg element.
* @return string
*/
function jio_get_comment_icon(string $name, string $class = 'icon'): string {
return jio_icon_markup('zibsvg-' . $name, $class);
return jio_icon_markup('jiosvg-' . $name, $class);
}
endif;
+1 -1
View File
@@ -163,7 +163,7 @@ if (!function_exists('jio_get_comment_report_html')) :
if ($author_id > 0 && $author_id === $reporter_id) {
return '';
}
// 已封禁/小黑屋用户不再显示举报入口(参考主题 zib_get_report_link 排除语义)。
// 已封禁/小黑屋用户不再显示举报入口。
if ($author_id > 0 && function_exists('jio_is_user_ban_restricted') && jio_is_user_ban_restricted($author_id)) {
return '';
}
+1 -1
View File
@@ -43,7 +43,7 @@ if (!function_exists('jio_homepage_get_latest_query')) {
$query_args['category__not_in'] = $exclude_cat_ids;
}
// legacy zib_sift_posts_per_orde:排序菜单的 ?orderby= 优先于后台默认排序。
// 排序菜单的 ?orderby= 优先于后台默认排序。
$request_sort = jio_homepage_get_request_sort();
$query = new WP_Query(
$request_sort !== ''
+4 -4
View File
@@ -114,7 +114,7 @@ if (!function_exists('jio_header_slide_is_show')) {
return false;
}
// Zibll only displays this component on the first archive page.
// This component only displays on the first archive page.
if ((int) $wp_query->get('paged') > 1) {
return false;
}
@@ -441,9 +441,9 @@ if (!function_exists('jio_header_slide')) {
$card_options = wp_parse_args((array) ($args['header_slider_card_option'] ?? []), [
'icon_radius4' => false, 'show_widget_bg' => false, 'cards' => [],
]);
// legacy (Zibll): with module background the card shrinks to
// padding-10 inside a .zib-widget wrapper (.jio-panel here); the
// bg-less variant stretches each card in a .flex1 column.
// With module background the card shrinks to padding-10 inside a
// .jio-widget-box wrapper (.jio-panel here); the bg-less variant
// stretches each card in a .flex1 column.
$show_bg = !empty($card_options['show_widget_bg']);
$items = '';
foreach ((array) $card_options['cards'] as $card) {
+2 -2
View File
@@ -71,7 +71,7 @@ if (!function_exists('jio_homepage_render_layout')) {
if (!function_exists('jio_homepage_get_tab_header_html')) {
/**
* legacy zib_index_tab_html:tab 导航 / 翻页标题条 / 空占位 三态。
* 首页 tab 头:tab 导航 / 翻页标题条 / 空占位 三态。
*
* @param array<int, array<string, mixed>> $tab_configs Configured term tabs.
*/
@@ -108,7 +108,7 @@ if (!function_exists('jio_homepage_get_tab_header_html')) {
if (!function_exists('jio_homepage_get_tab_panes_html')) {
/**
* legacy zib_index_tab('content'):每个栏目的原位刷新 pane。
* 每个栏目的原位刷新 pane。
*
* pane 本身就是 .ajaxpager;post_ajax_trigger 指向栏目页,post_ajax 加载后
* 用栏目页自身的列表 DOM 原地替换 loader,不新建区域。
+2 -2
View File
@@ -216,8 +216,8 @@ if (!function_exists('jio_archive_build_custom_filter_groups')) :
/**
* Build custom advanced-filter dimension groups.
*
* Reference: zib_get_option_custom_filter_but — one labeled chip group per
* dimension; when a value is active an extra "all" chip prepends to clear it.
* One labeled chip group per dimension; when a value is active an extra
* "all" chip prepends to clear it.
*
* @param array<int,array<string,mixed>> $dimensions Dimension definitions (custom_filter settings).
* @param mixed $keys 'all' or list of enabled dimension keys.
+1 -1
View File
@@ -206,7 +206,7 @@ if (!function_exists('jio_archive_render_stream')) :
<?php echo $args['filter_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php if ($has_posts) : ?>
<?php
// legacy 契约:分页渲染在 .ajaxpager 内部(zib_paging 位置),
// 分页渲染在 .ajaxpager 内部,
// 首页更多栏目 tab 的 runtime post_ajax 依赖它提取下一页。
ob_start();
jio_render_pagination($query, [
+2 -2
View File
@@ -424,8 +424,8 @@ if (!function_exists('jio_comments_render_form')) :
if (!$is_logged_in) {
jio_comments_render_signarea($ctx);
} else {
// 治理状态区分提示(参考主题 zib_get_user_ban_nocan_info 语义:
// 禁封中/小黑屋/禁言显示状态徽章与查看入口,而非笼统的无权限文案)。
// 治理状态区分提示:禁封中/小黑屋/禁言显示状态徽章与查看入口,
// 而非笼统的无权限文案。
$ban_nocan = function_exists('jio_get_user_ban_nocan_html')
? jio_get_user_ban_nocan_html(get_current_user_id(), __('暂时无法发表评论', 'jio'))
: '';
+2 -2
View File
@@ -1,6 +1,6 @@
<?php
/**
* 右侧悬浮按钮前台输出(结构对齐参考主题 zib_float_right())。
* 右侧悬浮按钮前台输出。
*
* @package Jio
*/
@@ -221,7 +221,7 @@ if (!function_exists('jio_float_right')) :
return;
}
// 扩展点(对齐参考主题 zib_float_right filter):模块可注入自定义悬浮按钮。
// 扩展点:模块可注入自定义悬浮按钮。
$btn = (string) apply_filters('jio_float_right_buttons', $btn, $is_mobile);
if ($btn === '') {
return;
+1 -1
View File
@@ -310,7 +310,7 @@ if (! function_exists('jio_cut_count')) :
endif;
if (! function_exists('jio_str_cut')) :
/**
* legacy parity: 按显示宽度截断标题(ASCII 记 1、CJK 记 2,zib_str_cut)。
* 按显示宽度截断标题(ASCII 记 1、CJK 记 2)。
*/
function jio_str_cut(string $str, int $start = 0, int $width = 100, string $trimmarker = '...'): string {
if ($str === '' || $width <= 0) {
+2 -3
View File
@@ -39,10 +39,9 @@ endif;
if (!function_exists('jio_render_new_add_btns')) :
/**
* Publish chip (legacy newadd-btns, single action).
* Publish chip (single action).
*
* Mirrors the single-button branch of the reference zib_get_new_add_btns():
* the paint classes ride on the anchor itself and the label is emitted
* The paint classes ride on the anchor itself and the label is emitted
* verbatim. Only the post action exists, so there is no dropdown branch.
*
* @param string[] $types
+6 -6
View File
@@ -9,7 +9,7 @@ defined('ABSPATH') || exit;
if (!function_exists('jio_get_user_checkin_details_link')) :
/**
* 已签到详情弹窗触发链接(参考主题 zib_get_user_checkin_details_link 1:1):
* 已签到详情弹窗触发链接:
* 打开刷新式 mini 弹窗(高 240,移动端底部弹出,每次都重新拉取)。
*
* @param string $class 沿用入口按钮的类。
@@ -135,8 +135,8 @@ if (!function_exists('jio_header_user_wallet_mini')) :
$center = function_exists('jio_get_user_center_url') ? jio_get_user_center_url('credits') : '#';
$box = '';
$balance_icon = jio_icon_markup('zibsvg-money-color-2', 'em14');
$points_icon = jio_icon_markup('zibsvg-points-color', 'em14');
$balance_icon = jio_icon_markup('jiosvg-money-color-2', 'em14');
$points_icon = jio_icon_markup('jiosvg-points-color', 'em14');
if ($balance_on) {
$box .= '<a rel="nofollow" style="flex: 1;" class="muted-box padding-6 flex1 radius4" href="' . esc_url($center) . '">'
@@ -199,9 +199,9 @@ if (!function_exists('jio_header_payvip_bar')) :
if ($level > 0) {
$levels = is_array($vip['levels'] ?? null) ? $vip['levels'] : [];
$name = (string) ($levels[$level]['name_html'] ?? $levels[$level]['name'] ?? ($level === 2 ? __('二级会员', 'jio') : __('一级会员', 'jio')));
// 到期徽章语义对齐参考主题 zib_get_user_vip_exp_date_text():只有真的拿到
// 到期徽章语义:只有真的拿到
// 到期时间才渲染这枚徽章,已过期显示「会员已过期」否则显示裸日期;显式永久
// 会员显示「永久会员」;拿不到到期数据时参考主题返回 false,整枚徽章不渲染。
// 会员显示「永久会员」;拿不到到期数据时整枚徽章不渲染。
$exp_label = '';
if (function_exists('jio_get_user_vip_state')) {
$state = jio_get_user_vip_state($user_id);
@@ -230,7 +230,7 @@ if (!function_exists('jio_header_payvip_bar')) :
return '';
}
// 1:1 对齐参考主题 zib_get_header_payvip_icon():通栏、radius4、vip_1 SVG 图标、裸文案。
// 通栏、radius4、vip_1 SVG 图标、裸文案。
return '<div class="mt10 em09" style="padding:2px;">'
. '<a class="pay-vip but radius4 payvip-icon btn-block" href="javascript:;">'
. '<svg class="em12 mr6" aria-hidden="true"><use xlink:href="#icon-vip_1"></use></svg>'
+5 -5
View File
@@ -114,7 +114,7 @@ if (!function_exists('jio_homepage_get_sort_mode')) {
if (!function_exists('jio_homepage_get_request_sort')) {
/**
* Main-stream sort requested by URL (?orderby=), legacy zib_sift_posts_per_orde.
* Main-stream sort requested by URL (?orderby=).
*
* 排序菜单(.ajax-option)点击后原位刷新的响应页靠它同序。
*/
@@ -218,7 +218,7 @@ if (!function_exists('jio_homepage_apply_named_sort_args')) {
if (!function_exists('jio_homepage_render_ajax_option_menu')) {
/**
* 首页排序菜单,1:1 zib_ajax_option_menu('home')。
* 首页排序菜单。
*
* 输出 .ajax-option.ajax-replace[win-ajax-replace="filter"],点击 .ajax-next
* 排序链接由 runtime post_ajax 原位替换 #index-tab-main 内的列表。
@@ -248,7 +248,7 @@ if (!function_exists('jio_homepage_render_ajax_option_menu')) {
if (!function_exists('jio_homepage_get_option_orderby_but')) {
/**
* 排序方式按钮组,1:1 zib_get_option_orderby_but。
* 排序方式按钮组。
*
* @param array{lists?:string[],dropdown?:bool} $option Sort option config.
*/
@@ -316,7 +316,7 @@ if (!function_exists('jio_homepage_get_option_orderby_but')) {
if (!function_exists('jio_homepage_get_current_url')) {
/**
* 当前页面链接,1:1 zib_get_current_url。
* 当前页面链接。
*/
function jio_homepage_get_current_url(): string {
$home_url = home_url();
@@ -328,7 +328,7 @@ if (!function_exists('jio_homepage_get_current_url')) {
if (!function_exists('jio_homepage_url_del_paged')) {
/**
* 移除分页参数的链接,1:1 zib_url_del_paged。
* 移除分页参数的链接。
*/
function jio_homepage_url_del_paged(string $url): string {
$url = remove_query_arg(['paged', 'page'], $url);
+5 -5
View File
@@ -11,7 +11,7 @@ if (!function_exists('jio_icon_card_kses_tags')) :
/**
* Inline HTML allow-list for icon card title/desc fields.
*
* legacy (Zibll) stores and echoes card title/desc raw, so admin-authored
* Card title/desc are stored and echoed raw, so admin-authored
* markup such as `<badge class="ml6 jb-blue">GO <span class="fa ..."></span></badge>`
* renders verbatim. `badge` is a custom element missing from WP's
* `$allowedposttags`, so `wp_kses_post()` strips it; these fields must go
@@ -54,12 +54,12 @@ if (!function_exists('jio_card_icon_inner')) :
*
* The universal icon picker stores three formats:
* - "fa fas fa-star" — FA5 class string
* - "zibsvg-hot" — theme built-in SVG sprite key
* - "jiosvg-hot" — theme built-in SVG sprite key
* - "customsvg-<svg>" — inline custom SVG markup
*
* Every format must be routed through jio_icon_markup(); emitting a bare
* FA class string silently produced an empty glyph for the two SVG formats
* (e.g. `<i class="fa fas fa-zibsvg-hot">`), so the card rendered without an
* (e.g. `<i class="fa fas fa-jiosvg-hot">`), so the card rendered without an
* icon whenever the admin picked 内置 SVG or 自定义 SVG.
*
* Raw inline markup without a picker prefix is still accepted for data
@@ -75,7 +75,7 @@ if (!function_exists('jio_card_icon_inner')) :
return '';
}
$is_picker_svg = str_starts_with($value, 'zibsvg-') || str_starts_with($value, 'customsvg-');
$is_picker_svg = str_starts_with($value, 'jiosvg-') || str_starts_with($value, 'customsvg-');
if (!$is_picker_svg && str_contains($value, '<')) {
$allowed = function_exists('jio_svg_kses_tags') ? jio_svg_kses_tags() : [];
@@ -270,7 +270,7 @@ if (!function_exists('jio_icon_cover_card')) :
$custom_src = (string) ($args['custom_icon'] !== '' ? $args['custom_icon'] : $args['customize_icon']);
$icon_img = esc_url_raw(trim((string) ($args['icon_image'] !== '' ? $args['icon_image'] : '')));
$custom_html = '';
$custom_is_picker = str_starts_with($custom_src, 'zibsvg-') || str_starts_with($custom_src, 'customsvg-');
$custom_is_picker = str_starts_with($custom_src, 'jiosvg-') || str_starts_with($custom_src, 'customsvg-');
if ($icon_img === '' && $custom_is_picker) {
// A picker value routed into the custom slot must go through the
// shared renderer, otherwise the "customsvg-" prefix leaks as text.
+10 -10
View File
@@ -53,11 +53,11 @@ function jio_brand_icon_map(): array {
}
// FA5 Free ships no Gitee brand glyph and no multi-colour Google mark, so
// those two resolve to the theme's built-in SVG sprite (zibsvg-*) instead of
// those two resolve to the theme's built-in SVG sprite (jiosvg-*) instead of
// a solid stand-in; every other key stays on FA5.
$map = [
'github' => 'fa fab fa-github',
'google' => 'zibsvg-google-color',
'google' => 'jiosvg-google-color',
'x' => 'fa fab fa-twitter',
'twitter' => 'fa fab fa-twitter',
'email' => 'fa fas fa-envelope',
@@ -75,7 +75,7 @@ function jio_brand_icon_map(): array {
'instagram' => 'fa fab fa-instagram',
'web' => 'fa fas fa-globe',
'globe' => 'fa fas fa-globe',
'gitee' => 'zibsvg-gitee',
'gitee' => 'jiosvg-gitee',
'baidu' => 'fa fas fa-paw',
'alipay' => 'fa fab fa-alipay',
];
@@ -131,8 +131,8 @@ if (!function_exists('jio_brand_icon_class')) :
/**
* Resolve a short key, FA class string or sprite key to its icon value.
*
* @param string $name Short key, full FA class string or zibsvg-/customsvg- value.
* @return string e.g. 'fa fab fa-github' or 'zibsvg-gitee', or '' if unknown.
* @param string $name Short key, full FA class string or jiosvg-/customsvg- value.
* @return string e.g. 'fa fab fa-github' or 'jiosvg-gitee', or '' if unknown.
*/
function jio_brand_icon_class(string $name): string {
$raw = trim($name);
@@ -142,7 +142,7 @@ function jio_brand_icon_class(string $name): string {
// Built-in SVG sprite and inline SVG values pass straight through; they are
// not FA class strings and must survive to the markup renderer untouched.
if (preg_match('/^(?:zibsvg|customsvg)-/i', $raw)) {
if (preg_match('/^(?:jiosvg|customsvg)-/i', $raw)) {
return $raw;
}
@@ -174,7 +174,7 @@ if (!function_exists('jio_brand_icon')) :
/**
* Escaped markup for a brand/contact icon (FA5 <i> or built-in SVG sprite).
*
* @param string $name Short key, FA class string or zibsvg-/customsvg- value.
* @param string $name Short key, FA class string or jiosvg-/customsvg- value.
* @param array|string $extra_classes Optional extra classes.
* @return string Safe HTML or empty string when unknown.
*/
@@ -183,7 +183,7 @@ function jio_brand_icon(string $name, $extra_classes = []): string {
// Sprite and inline-SVG values carry their own element, so the shared icon
// renderer owns the markup (it emits <svg class="icon"><use …>).
if (strpos($class, 'zibsvg-') === 0 || strpos($class, 'customsvg-') === 0) {
if (strpos($class, 'jiosvg-') === 0 || strpos($class, 'customsvg-') === 0) {
return jio_icon_markup($class, $extra_classes);
}
@@ -320,7 +320,7 @@ if (!function_exists('jio_icon_markup')) :
* - "fa fas fa-star" / "fa fab fa-weixin" — FA5 class string
* - "fa-star" — bare glyph, rendered as solid FA5
* - legacy FA4 string — double-`fa` form, upgraded to FA5
* - "zibsvg-hot" — theme built-in SVG sprite key
* - "jiosvg-hot" — theme built-in SVG sprite key
* - "customsvg-<svg …>" — inline user SVG markup
*
* Output is always FA5 — the legacy FA4 double-`fa` prefix is never emitted.
@@ -357,7 +357,7 @@ function jio_icon_markup(string $value, $extra_classes = []): string {
return $svg;
}
if (str_starts_with($value, 'zibsvg-')) {
if (str_starts_with($value, 'jiosvg-')) {
$key = sanitize_key(substr($value, 7));
if ($key === '') {
return '';
+9 -10
View File
@@ -105,7 +105,7 @@ if (!function_exists('jio_list_cash_payment_methods')) {
return [];
}
// 渠道展示名对齐参考主题 zibpay_get_payment_method_args:
// 渠道展示名映射:
// 微信 / 支付宝 / 余额 / 卡密 / PayPal / Stripe(网关 get_name 仅供
// 订单等内部场景,支付方式 UI 统一用本映射)。
$labels = [
@@ -163,10 +163,9 @@ if (!function_exists('jio_payment_order_slots')) {
/**
* 按后台「收款接口显示顺序」(pay_sdk_order)重排支付方式列表。
*
* 语义对齐参考主题 zibpay_get_payment_methods():按配置槽位顺序把命中的方式
* 依次提到前面,未纳入槽位的方式保持原有相对顺序并留在末尾;未配置顺序时
* 原样返回(即保持注册顺序)。这是排序的唯一实现,所有收银台构建支付方式
* 列表的位置都必须经由此函数。
* 按配置槽位顺序把命中的方式依次提到前面,未纳入槽位的方式保持原有相对顺序
* 并留在末尾;未配置顺序时原样返回(即保持注册顺序)。这是排序的唯一实现,
* 所有收银台构建支付方式列表的位置都必须经由此函数。
*
* @param array<int, array{id:string,name:string}> $methods
* @return array<int, array{id:string,name:string}>
@@ -1426,11 +1425,11 @@ if (!function_exists('jio_get_paywall_html')) {
JIO_PAY_TYPE_VIDEO => '<i class="fa fas fa-play-circle fa-fw" aria-hidden="true"></i>' . esc_html__('查看视频', 'jio'),
];
$view_label = $view_labels[$pay_type] ?? '<i class="fa far fa-dot-circle fa-fw" aria-hidden="true"></i>' . esc_html__('查看内容', 'jio');
return '<div class="zib-widget pay-box pay-widget paid-box order-type-' . $order_type . '" style="padding:0">' . $tag . '<div class="relative-h ' . esc_attr($theme) . '" style="background-size:120%"><div class="pay-widget__orb pay-widget__orb--right ' . esc_attr($theme) . '"></div><div class="pay-widget__orb pay-widget__orb--left ' . esc_attr($theme) . '"></div><div class="relative box-body"><div class="text-center mt10 box-body"><p><i class="fa fas fa-shopping-bag fa-3x" aria-hidden="true"></i></p><b class="em14">' . esc_html__('已购买', 'jio') . '</b></div></div></div><div class="box-body">' . $widget_service . '<div class="mt10"><a href="#posts-pay" class="but padding-lg btn-block ' . esc_attr($theme) . '">' . $view_label . '</a></div>' . $demo_row . $attrs . '</div>' . $count . '</div>';
return '<div class="jio-widget-box pay-box pay-widget paid-box order-type-' . $order_type . '" style="padding:0">' . $tag . '<div class="relative-h ' . esc_attr($theme) . '" style="background-size:120%"><div class="pay-widget__orb pay-widget__orb--right ' . esc_attr($theme) . '"></div><div class="pay-widget__orb pay-widget__orb--left ' . esc_attr($theme) . '"></div><div class="relative box-body"><div class="text-center mt10 box-body"><p><i class="fa fas fa-shopping-bag fa-3x" aria-hidden="true"></i></p><b class="em14">' . esc_html__('已购买', 'jio') . '</b></div></div></div><div class="box-body">' . $widget_service . '<div class="mt10"><a href="#posts-pay" class="but padding-lg btn-block ' . esc_attr($theme) . '">' . $view_label . '</a></div>' . $demo_row . $attrs . '</div>' . $count . '</div>';
}
if ($is_widget) {
return '<div class="zib-widget pay-box pay-widget order-type-' . $order_type . '" style="padding:0">' . $tag . '<div class="relative-h ' . esc_attr($theme) . '" style="background-size:120%"><div class="pay-widget__orb pay-widget__orb--right ' . esc_attr($theme) . '"></div><div class="pay-widget__orb pay-widget__orb--left ' . esc_attr($theme) . '"></div><div class="relative box-body"><div class="text-center mt10">' . $price . '</div></div><div class="relative">' . $vip . '</div></div>' . $discount_banner . '<div class="box-body">' . $widget_service . '<div class="mt10">' . $button . '</div>' . $demo_row . $attrs . '</div>' . $count . '</div>';
return '<div class="jio-widget-box pay-box pay-widget order-type-' . $order_type . '" style="padding:0">' . $tag . '<div class="relative-h ' . esc_attr($theme) . '" style="background-size:120%"><div class="pay-widget__orb pay-widget__orb--right ' . esc_attr($theme) . '"></div><div class="pay-widget__orb pay-widget__orb--left ' . esc_attr($theme) . '"></div><div class="relative box-body"><div class="text-center mt10">' . $price . '</div></div><div class="relative">' . $vip . '</div></div>' . $discount_banner . '<div class="box-body">' . $widget_service . '<div class="mt10">' . $button . '</div>' . $demo_row . $attrs . '</div>' . $count . '</div>';
}
$thumb = get_the_post_thumbnail($post, 'medium', ['class' => 'fit-cover', 'alt' => '']);
@@ -1454,7 +1453,7 @@ if (!function_exists('jio_get_paywall_html')) {
$graphic = '<div class="flex0 relative mr20 hide-sm pay-thumb"><div class="graphic">' . $thumb . $graphic_actions . '</div></div>';
}
$demo_mobile = $demo !== '' ? '<div class="mt10 visible-xs-block">' . $demo . '</div>' : '';
return '<div class="zib-widget pay-box order-type-' . $order_type . '" id="posts-pay"><div class="flex pay-flexbox">' . $graphic . '<div class="flex-auto-h flex xx jsb"><dt class="text-ellipsis pay-title">' . esc_html($title) . '</dt><div class="mt6 em09 muted-2-color">' . wp_kses_post($doc) . '</div><div>' . $price . '</div>' . $discount_mobile . ($vip !== '' ? '<div>' . $vip . '</div>' : '') . '<div class="text-right mt10">' . $button . '</div></div></div>' . $article_service . $demo_mobile . $attrs . $tag . $count . '</div>';
return '<div class="jio-widget-box pay-box order-type-' . $order_type . '" id="posts-pay"><div class="flex pay-flexbox">' . $graphic . '<div class="flex-auto-h flex xx jsb"><dt class="text-ellipsis pay-title">' . esc_html($title) . '</dt><div class="mt6 em09 muted-2-color">' . wp_kses_post($doc) . '</div><div>' . $price . '</div>' . $discount_mobile . ($vip !== '' ? '<div>' . $vip . '</div>' : '') . '<div class="text-right mt10">' . $button . '</div></div></div>' . $article_service . $demo_mobile . $attrs . $tag . $count . '</div>';
}
}
@@ -1533,7 +1532,7 @@ if (!function_exists('jio_get_paid_download_actions_html')) {
}
/**
* Purchased article card matching Zibll's paid-box structure.
* Purchased article card, rendered in the paid-box structure.
*/
if (!function_exists('jio_get_paid_box_html')) {
function jio_get_paid_box_html(WP_Post $post): string {
@@ -1632,7 +1631,7 @@ if (!function_exists('jio_get_paid_box_html')) {
$pay_extra_hide = trim((string) ($meta['pay_extra_hide'] ?? ''));
$pay_extra_hide = $pay_extra_hide !== '' ? '<div class="pay-extra-hide">' . $pay_extra_hide . '</div>' : '';
return '<div class="pay-box zib-widget paid-box order-type-' . $order_type . '" id="posts-pay"' . $root_data . '>'
return '<div class="pay-box jio-widget-box paid-box order-type-' . $order_type . '" id="posts-pay"' . $root_data . '>'
. $header
. $paid_box
. '<div class="' . esc_attr($body_class) . '">'
+3 -3
View File
@@ -24,7 +24,7 @@ if (!function_exists('jio_get_rewards_button')) {
}
$settings = \Jio\Settings\Settings::get_post_page_settings();
$label = (string) ($settings['rewards_btn_text'] ?? __('赞赏', 'jio'));
$icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-money') : '';
$icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-money') : '';
$template_id = 'jio-reward-template-' . $user_id . '-' . $post_id;
return sprintf(
'<button type="button" class="%1$s jio-reward-open" data-jio-reward-open data-template-id="%2$s" data-user-id="%3$d" data-post-id="%4$d">%5$s<text>%6$s</text></button>',
@@ -62,8 +62,8 @@ if (!function_exists('jio_render_rewards_template_for_user')) {
$recipient = get_userdata($user_id);
$template_id = 'jio-reward-template-' . $user_id . '-' . $post_id;
$title = (string) ($settings['rewards_text'] ?? __('赞赏', 'jio'));
$money_icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-money') : '<i class="fa fas fa-money-bill-wave" aria-hidden="true"></i>';
$close_icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-close', 'ic-close') : '<i class="fa fas fa-times" aria-hidden="true"></i>';
$money_icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-money') : '<i class="fa fas fa-money-bill-wave" aria-hidden="true"></i>';
$close_icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-close', 'ic-close') : '<i class="fa fas fa-times" aria-hidden="true"></i>';
?>
<template id="<?php echo esc_attr($template_id); ?>" data-user-id="<?php echo (int) $user_id; ?>" data-post-id="<?php echo (int) $post_id; ?>">
<div class="modal-colorful-header colorful-bg jb-blue">
+5 -5
View File
@@ -125,7 +125,7 @@ if (!function_exists('jio_get_share_buttons')) {
continue;
}
$icon_key = $key === 'email' ? 'd-email' : $key . '-color';
$icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-' . $icon_key) : '';
$icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-' . $icon_key) : '';
$attr = '';
$target = ' target="_blank"';
$href = jio_share_platform_href($key, $ctx);
@@ -165,7 +165,7 @@ if (!function_exists('jio_get_post_share_btn')) {
if (!$post instanceof WP_Post || jio_active_share_items() === []) {
return '';
}
$icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-share') : '<i class="fa fas fa-share-alt"></i>';
$icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-share') : '<i class="fa fas fa-share-alt"></i>';
$text = $show_text ? '<text>' . esc_html__('分享', 'jio') . '</text>' : '';
if ($modal || wp_is_mobile()) {
$count = max(1, count(jio_active_share_items()));
@@ -175,7 +175,7 @@ if (!function_exists('jio_get_post_share_btn')) {
. '" data-jio-modal-mobile-bottom="true" data-jio-modal-cache="false">' . $icon . $text . '</a>';
}
return '<span class="hover-show dropup ' . esc_attr($class) . '">' . $icon . $text
. '<div class="zib-widget hover-show-con share-button dropdown-menu">' . jio_get_share_html('', $post) . '</div></span>';
. '<div class="jio-widget-box hover-show-con share-button dropdown-menu">' . jio_get_share_html('', $post) . '</div></span>';
}
}
@@ -188,9 +188,9 @@ if (!function_exists('jio_share_modal_ajax')) {
echo '<div class="box-body text-center">' . esc_html__('内容不存在或参数错误', 'jio') . '</div>';
exit;
}
$icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-share', 'em14') : '';
$icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-share', 'em14') : '';
echo '<div class="modal-colorful-header colorful-bg jb-vip1"><button type="button" class="close" data-jio-modal-close aria-label="' . esc_attr__('关闭', 'jio') . '">'
. (function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-close', 'ic-close') : '&times;')
. (function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-close', 'ic-close') : '&times;')
. '</button><div class="colorful-make"></div><div class="text-center"><div class="em2x">' . $icon
. '</div><div class="mt10 em12 padding-w10"><span class="em09">' . esc_html__('分享内容', 'jio') . '</span></div></div></div>'
. jio_get_share_html('horizontal', $post); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
+1 -1
View File
@@ -134,7 +134,7 @@ if (!function_exists('jio_get_single_meta_box')) :
$more .= '<button type="button" class="but cir post-drop-meta__toggle" aria-haspopup="true" aria-controls="' . esc_attr($menu_id) . '" aria-expanded="false" aria-label="' . esc_attr__('更多', 'jio') . '">';
$more .= '<i class="fa fas fa-ellipsis-h" aria-hidden="true"></i></button>';
$more .= '<div id="' . esc_attr($menu_id) . '" class="post-drop-meta__menu" aria-hidden="true">';
// 首项(参考主题 zib_get_post_more_dropdown 顺序):管理员 → 禁封用户;
// 首项:管理员 → 禁封用户;
// 无禁封权限时不占位,由下方举报项兜底(「禁封优先、否则举报」互斥语义)。
$ban_item = function_exists('jio_get_post_author_ban_item')
? jio_get_post_author_ban_item((int) get_post_field('post_author', $post_id), (string) $permalink)
+9 -9
View File
@@ -196,7 +196,7 @@ if (!function_exists('jio_single_render_actions')) :
<div class="post-actions-wrap relative">
<div class="text-center post-actions">
<?php
$like_icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-like') : '';
$like_icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-like') : '';
$like_label = function_exists('jio_format_number') ? jio_format_number($like_count) : number_format_i18n($like_count);
if (!empty($settings['like_enabled'])) : ?>
<button type="button" class="action action-like<?php echo $is_liked ? ' actived' : ''; ?>" id="action-like" data-post-id="<?php echo esc_attr((string) $post_id); ?>" data-initial-active="<?php echo $is_liked ? '1' : '0'; ?>">
@@ -221,7 +221,7 @@ if (!function_exists('jio_single_render_actions')) :
<?php endif; ?>
<?php
$favorite_icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-favorite') : '';
$favorite_icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-favorite') : '';
$favorite_label = function_exists('jio_format_number') ? jio_format_number($favorite_count) : number_format_i18n($favorite_count);
if (!empty($settings['favorite_enabled'])) : ?>
<button type="button" class="action action-favorite<?php echo $is_favorited ? ' actived' : ''; ?>" id="action-favorite" data-post-id="<?php echo esc_attr((string) $post_id); ?>" data-initial-active="<?php echo $is_favorited ? '1' : '0'; ?>">
@@ -273,8 +273,8 @@ endif;
if (!function_exists('jio_single_render_author_card')) :
/**
* After-article author card (legacy zib_get_user_card_box parity:
* show_button=false / show_img_bg=false / class="author").
* After-article author card (show_button=false / show_img_bg=false /
* class="author").
*
* @param array<string,mixed> $ctx Single context.
*/
@@ -308,7 +308,7 @@ if (!function_exists('jio_single_render_author_card')) :
'exclude' => (int) get_the_ID(),
]);
?>
<div class="user-card zib-widget author">
<div class="user-card jio-widget-box author">
<div class="card-content mt10 relative">
<div class="user-content">
<div class="user-avatar"><?php echo $avatar_box; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
@@ -381,8 +381,8 @@ endif;
if (!function_exists('jio_single_related_query_args')) :
/**
* Build related-posts WP_Query args (legacy zib_posts_related parity:
* category/topics/tag OR-terms, no current-post exclusion, meta orderby).
* Build related-posts WP_Query args (category/topics/tag OR-terms,
* no current-post exclusion, meta orderby).
*
* @param int $post_id Post ID.
* @param array<string,mixed> $settings Single display settings.
@@ -450,7 +450,7 @@ endif;
if (!function_exists('jio_single_render_related')) :
/**
* Related posts — legacy zib_posts_related parity (img/list/text).
* Related posts (img/list/text).
*
* @param array<string,mixed> $ctx Single context.
*/
@@ -508,7 +508,7 @@ if (!function_exists('jio_single_render_related')) :
<div class="box-body notop">
<div class="title-theme"><?php echo esc_html($title); ?></div>
</div>
<div class="zib-widget">
<div class="jio-widget-box">
<?php if ($style === 'img') : ?>
<div class="swiper-container swiper-scroll">
<div class="swiper-wrapper"><?php echo $posts_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
-1
View File
@@ -193,7 +193,6 @@ if (!function_exists('jio_render_user_home_pagination')) {
if (!function_exists('jio_get_user_home_follow_placeholder')) {
/**
* Skeleton cards used while the public home follow panel is loading.
* Mirrors zib_get_author_tab_loader('follow').
*/
function jio_get_user_home_follow_placeholder(): string {
$item = '<div class="author-minicard radius8 flex ac uh-follow__placeholder" aria-hidden="true">'
+6 -6
View File
@@ -425,15 +425,15 @@ if (!function_exists('jio_get_vip_purchase_url')) {
}
/**
* 用户中心 /user/vip/ 页面的积分兑换会员入口(参考主题 zibpay_user_page_tab_content_vip 1:1)。
* 用户中心 /user/vip/ 页面的积分兑换会员入口。
*
* 参考主题在「我的会员」摘要与两张档位购买卡之后输出全宽入口横条:
* .c-yellow.zib-widget.flex.ac.jsb(zib-widget → 本主题 jio-panel 表面)
* 在「我的会员」摘要与两张档位购买卡之后输出全宽入口横条:
* .c-yellow.jio-widget-box.flex.ac.jsb(jio-widget-box → 本主题 jio-panel 表面)
* ├─ .flex1.em12:points-color 图标 +「{自定义货币名}兑换会员」
* └─ .badg.radius.c-yellow:「立即兑换」+ fa-chevron-circle-right
* 门控对齐参考主题 zibpay_get_vip_points_exchange_link:已是会员不展示
* ($vip_level ? '' : link),且要求积分兑换会员开启、至少一个会员等级
* 开启并存在可兑换套餐(catalog.points_exchange 已内含 credits 门控)。
* 门控:已是会员不展示($vip_level ? '' : link),且要求积分兑换会员开启、
* 至少一个会员等级开启并存在可兑换套餐(catalog.points_exchange 已内含
* credits 门控)。
*
* 入口文案的货币名取 catalog.currency_name(后台「积分配置 → 自定义货币名称」),
* 与它打开的兑换弹窗标题、会员弹窗内的入口保持同一命名。
+3 -3
View File
@@ -1,6 +1,6 @@
<?php
/**
* 右上角待支付订单浮窗(结构对齐参考主题 zibpay_get_user_wait_pay_float_window())。
* 右上角待支付订单浮窗。
*
* @package Jio
*/
@@ -9,7 +9,7 @@ defined('ABSPATH') || exit;
if (!function_exists('jio_get_wait_pay_float_orders')) :
/**
* 当前登录用户的待支付订单(最多 5 条,剩余支付时间 ≥ 3 分钟,对齐参考主题口径)。
* 当前登录用户的待支付订单(最多 5 条,剩余支付时间 ≥ 3 分钟)。
*
* @return array<int,array{view:array<string,mixed>,expires:int}>
*/
@@ -38,7 +38,7 @@ endif;
if (!function_exists('jio_get_wait_pay_order_thumb')) :
/**
* 订单缩略图:商品图优先,否则按订单类型回退彩色图标(对齐 zibpay_get_order_order_thumb)。
* 订单缩略图:商品图优先,否则按订单类型回退彩色图标。
*
* @param array<string,mixed> $view
*/
+3 -3
View File
@@ -13,7 +13,7 @@ defined('ABSPATH') || exit;
if (!function_exists('jio_widget_str_cut')) :
/**
* Character-based truncation (reference zib_str_cut parity).
* Character-based truncation.
*/
function jio_widget_str_cut(string $text, int $length): string {
$text = trim($text);
@@ -184,7 +184,7 @@ if (!function_exists('jio_widget_hot_posts')) :
}
wp_reset_postdata();
return '<div class="zib-widget hot-posts">' . $posts_html . '</div>';
return '<div class="jio-widget-box hot-posts">' . $posts_html . '</div>';
}
endif;
@@ -285,7 +285,7 @@ if (!function_exists('jio_widget_term_aggregation')) :
}
wp_reset_postdata();
$html = '<div class="zib-widget term-aggregation mb10">';
$html = '<div class="jio-widget-box term-aggregation mb10">';
$html .= '<div class="mb20 hover-zoom-img flex px12-sm px12-m-s">';
$html .= $img_html;
$html .= '<div class="term-title ml10 flex xx flex1 jsb">' . $name . $description . $meta . '</div>';
+3 -3
View File
@@ -28,7 +28,7 @@ function jio_menu_pz(int $id, string $key = '', $default = '') {
}
/**
* @param string $icon_class Icon-picker value (FA5 class, zibsvg- or customsvg-).
* @param string $icon_class Icon-picker value (FA5 class, jiosvg- or customsvg-).
* @param bool $enabled Global switch.
*/
function jio_render_menu_icon(string $icon_class, bool $enabled = true): string {
@@ -37,8 +37,8 @@ function jio_render_menu_icon(string $icon_class, bool $enabled = true): string
}
// Sprite/inline values must reach jio_icon_markup untouched — the legacy
// FA class padding below would corrupt them (zibsvg-hot → fa fas fa-zibsvg-hot).
if (str_starts_with($icon_class, 'zibsvg-')) {
// FA class padding below would corrupt them (jiosvg-hot → fa fas fa-jiosvg-hot).
if (str_starts_with($icon_class, 'jiosvg-')) {
return jio_icon_markup($icon_class, 'icon mr3 menu-item-icon');
}
if (str_starts_with($icon_class, 'customsvg-')) {
+2 -2
View File
@@ -210,13 +210,13 @@ if (!function_exists('jio_render_mini_list')) {
if (!function_exists('jio_render_placeholder')) {
/**
* 骨架屏占位,1:1 对齐参考主题 `zib_get_post_placeholder()`。
* 骨架屏占位。
*
* 骨架块复用真实卡片的 posts-item / post-graphic / item-body 结构与尺寸,
* 只是把内容换成 .placeholder。列表模式四行(标题 t1、摘要 k1、k2、两枚 s1),
* 卡片模式三行(标题 t1、摘要 k2、两枚 s1)。
*
* 刻意与真实条目不同的两点(均与参考主题一致):
* 刻意与真实条目不同的两点:
* - **不写 `ajax-item`**:否则 `find('.ajax-item')` / ajax-list 的 `inject()`
* 会把骨架当成真实条目删除或定位。
* - **元素是 `<div>` 而非 `<posts>`**,且 card 分支的缩略图是
+2 -2
View File
@@ -225,7 +225,7 @@ if (!function_exists('jio_renderer_compact_pay_badge')) {
$label = esc_html__('会员专属', 'jio');
} else {
$display = \Jio\Settings\Settings::get_paid_content_settings()['display'];
$mark = $points ? jio_icon_markup('zibsvg-points', 'points-mark') : esc_html((string) ($display['currency_symbol'] ?? '¥'));
$mark = $points ? jio_icon_markup('jiosvg-points', 'points-mark') : esc_html((string) ($display['currency_symbol'] ?? '¥'));
$label = '<span class="em09">' . $mark . '</span>' . esc_html($price);
}
}
@@ -280,7 +280,7 @@ if (!function_exists('jio_renderer_meta_number')) {
if (!function_exists('jio_renderer_svg_icon')) {
function jio_renderer_svg_icon(string $name): string {
return jio_icon_markup('zibsvg-' . $name);
return jio_icon_markup('jiosvg-' . $name);
}
}
@@ -124,7 +124,7 @@ if (!function_exists('jio_render_pagination')) {
<div class="next-page order-ajax-next ias-btn<?php echo $auto_load ? ' lazyload' : ''; ?>"<?php echo $auto_load ? ' lazyload-action="ias"' : ''; ?>>
<a href="<?php echo esc_url(add_query_arg($page_var, $current_page + 1)); ?>" data-jio-load-more><?php echo wp_kses_post($trigger_text); ?></a>
</div>
<?php // 参考主题 zib_paging() 只渲染翻页控件,不在此处预渲染骨架;否则 runtime
<?php // 只渲染翻页控件,不在此处预渲染骨架;否则 runtime
// post_ajax() 会先在容器内找到它并复用,丢弃调用方按视口动态拼出的骨架,
// 排序切换于是永远是写死 2 条 list 形状。
// 骨架由 assets/js/core/pagination.js 在请求时按视口创建。 ?>
@@ -427,7 +427,7 @@ if (!function_exists('jio_render_footer_tabbar_single_extend')) :
$comment_label = function_exists('jio_format_number') ? jio_format_number($comment_count) : number_format_i18n($comment_count);
if ($like_on) :
$like_tabbar_icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-like') : '';
$like_tabbar_icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-like') : '';
?>
<button type="button"
class="tabbar-item single-action-tabbar action-like<?php echo $is_liked ? ' actived' : ''; ?>"
@@ -442,7 +442,7 @@ if (!function_exists('jio_render_footer_tabbar_single_extend')) :
endif;
if ($favorite_on) :
$favorite_tabbar_icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-favorite') : '';
$favorite_tabbar_icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-favorite') : '';
?>
<button type="button"
class="tabbar-item single-action-tabbar action-favorite<?php echo $is_favorited ? ' actived' : ''; ?>"
+2 -2
View File
@@ -476,7 +476,7 @@ endif;
if (!function_exists('jio_time_ago')) :
/**
* 将日期转为相对时间描述(中文,legacy zib_get_time_ago parity)。
* 将日期转为相对时间描述(中文)。
*
* @param string $date 日期字符串(MySQL datetime 格式)
* @return string 例如 "19天前"、"3个月前"
@@ -486,7 +486,7 @@ if (!function_exists('jio_time_ago')) :
$ctime = (int) strtotime(current_time('mysql'));
$t = $ctime - $time;
// 关闭倒计时显示时按「系统工具」自定义时间格式输出(legacy zib_get_time_ago parity)。
// 关闭倒计时显示时按「系统工具」自定义时间格式输出。
$system = class_exists('\Jio\Settings\ExtensionRuntime')
? \Jio\Settings\ExtensionRuntime::get_system_tools_settings()
: [];
+47 -66
View File
@@ -1,16 +1,12 @@
<?php
/**
* 前台用户禁封(小黑屋 / 封号)— 1:1 复刻参考主题 Zibll 前台禁封能力:
* zib_get_edit_user_ban_link → jio_get_edit_user_ban_link(三点菜单入口)
* zib_get_set_user_ban_modal → jio_get_user_ban_modal(禁封 / 解封弹窗)
* zib_get_ban_info_modal → jio_get_user_ban_info_modal(查看禁封状态)
* zib_get_user_ban_appeal_modal → jio_get_user_ban_appeal_modal(禁封申诉)
* zib_get_ban_log_modal → jio_get_user_ban_log_modal(禁封记录)
* zib_user_ban_restrict_login → jio_render_user_ban_block_page(登录后禁封页)
* 前台用户禁封(小黑屋 / 封号)— 1:1 复刻上游参考实现的前台用户禁封能力:
* 三点菜单入口、禁封 / 解封弹窗、查看禁封状态、禁封申诉、禁封记录、
* 登录后禁封页。
*
* 数据源唯一:\Jio\User\Restriction(wp_jio_user_restriction 表)。
* 弹窗内容经 REST /user-ban/*-modal 输出(JioModalRuntime.openRemote 拉取,
* 与参考主题 refresh_modal 每次刷新同语义),提交走 REST /user-ban/set 与
* 每次打开均重新拉取),提交走 REST /user-ban/set 与
* admin-ajax jio_ban_appeal_submit。
*
* @package Jio
@@ -25,10 +21,6 @@ defined('ABSPATH') || exit;
* (颜色 / 文案 / 图标统一管理);本 helper 供身份行徽章、用户中心元信息、
* 评论拒绝态等位置复用,避免重复查库。
*
* 对齐参考主题:
* zib_user_is_ban → jio_get_user_ban_state(状态判定)
* zib_ban_author_header_identity_filter → 资料卡/用户中心身份行徽章
*
* @return array{state:string,label:string,tone:string,icon:string}|array{} state 为空串表示无治理状态。
*/
function jio_get_user_ban_state(int $user_id): array
@@ -60,9 +52,8 @@ function jio_get_user_ban_state(int $user_id): array
}
/**
* 目标是否处于封禁/小黑屋状态(举报入口隐藏判定,参考主题
* zib_get_report_link 中 zib_user_is_ban($user_id) 的排除语义;
* 禁言为轻量评论域限制,不隐藏举报入口)。
* 目标是否处于封禁/小黑屋状态(举报入口隐藏判定:封号 / 小黑屋用户不展示
* 举报入口;禁言为轻量评论域限制,不隐藏举报入口)。
*/
function jio_is_user_ban_restricted(int $user_id): bool
{
@@ -71,8 +62,7 @@ function jio_is_user_ban_restricted(int $user_id): bool
}
/**
* 治理状态徽章(占据身份行元信息位,参考主题 author_header_identity 钩子 /
* zib_ban_author_header_identity_filter:badg + 图标 + 文案,红=封号、
* 治理状态徽章(占据身份行元信息位:badg + 图标 + 文案,红=封号、
* 黄=小黑屋、灰=禁言,字段与颜色由 Restriction::state_badges() 统一管理)。
*/
function jio_get_user_ban_identity_badge(int $user_id, string $class = ''): string
@@ -88,8 +78,7 @@ function jio_get_user_ban_identity_badge(int $user_id, string $class = ''): stri
}
/**
* 「查看禁封状态」入口(用户中心元信息位,参考主题 user_page_header_desc
* 钩子 / zib_get_user_ban_info_link:but 按钮 = 内层 badg 徽章(带色)+
* 「查看禁封状态」入口(用户中心元信息位:but 按钮 = 内层 badg 徽章(带色)+
* 右箭头,外层 but 为默认按钮色——不在内外两层重复着色)。
* 点击经 data-jio-ban-info 委托打开禁封信息弹窗。
*/
@@ -106,7 +95,7 @@ function jio_get_user_ban_info_link(int $user_id, string $class = ''): string
if ($badge === '') {
return '';
}
// 外层 but 不重复状态色:颜色仅由内层 badg 承载(1:1 参考主题)。
// 外层 but 不重复状态色:颜色仅由内层 badg 承载。
$classes = trim('but p2-10' . ($class !== '' ? ' ' . $class : ''));
return '<a class="' . esc_attr($classes) . '" href="javascript:;" role="button"'
. ' data-jio-ban-info="' . esc_attr((string) $user_id) . '"'
@@ -115,8 +104,7 @@ function jio_get_user_ban_info_link(int $user_id, string $class = ''): string
}
/**
* 禁封信息弹窗(1:1 复刻参考主题 zib_get_ban_info_modal:多彩头 c-gray +
* 禁封信息行 + 申诉入口;本人或管理员可见)。
* 禁封信息弹窗(多彩头 c-gray + 禁封信息行 + 申诉入口;本人或管理员可见)。
*
* @return string 弹窗 HTML(空串 = 无权查看或用户不存在)
*/
@@ -137,7 +125,7 @@ function jio_get_user_ban_info_modal(int $user_id): string
: [];
$html = '<div class="jio-user-ban-info-modal">';
// 弹窗头(参考主题 zib_get_modal_colorful_header('c-gray', ban 图标, 标题))。
// 弹窗头:灰色 colorful header,ban 图标 + 标题。
$html .= '<div class="modal-colorful-header colorful-bg c-gray"><button type="button" class="close" data-jio-modal-close aria-label="' . esc_attr__('关闭', 'jio') . '">' . jio_user_ban_close_svg() . '</button><div class="colorful-make"></div><div class="text-center"><div class="em2x"><i class="fa fas fa-ban" aria-hidden="true"></i></div><div class="mt10 em12 padding-w10">' . esc_html__('小黑屋禁封中', 'jio') . '</div></div></div>';
if (empty($info)) {
@@ -181,8 +169,8 @@ function jio_get_user_ban_info_modal(int $user_id): string
}
/**
* 「申诉」入口(参考主题 zib_get_user_ban_appeal_link:禁封申诉 modal-mini,
* 仅本人可发起;点击经 data-jio-ban-appeal 委托打开申诉弹窗)。
* 「申诉」入口(禁封申诉 modal-mini,仅本人可发起;
* 点击经 data-jio-ban-appeal 委托打开申诉弹窗)。
*/
function jio_get_user_ban_appeal_link(int $user_id, string $class = ''): string
{
@@ -197,9 +185,8 @@ function jio_get_user_ban_appeal_link(int $user_id, string $class = ''): string
}
/**
* 禁封申诉弹窗(1:1 复刻参考主题 zib_get_user_ban_appeal_modal:
* edit-header(gavel / c-blue / 禁封申诉)+ 禁封信息行 + 申诉说明 + 资料项
* 输入 + 审核中态 + 禁止申诉态;仅本人可见可提交)。
* 禁封申诉弹窗(edit-header(gavel / c-blue / 禁封申诉)+ 禁封信息行 +
* 申诉说明 + 资料项输入 + 审核中态 + 禁止申诉态;仅本人可见可提交)。
*
* @return string 弹窗 HTML(空串 = 非本人或用户不存在)
*/
@@ -218,7 +205,7 @@ function jio_get_user_ban_appeal_modal(int $user_id): string
$status = class_exists('\Jio\User\BanAppeal') ? \Jio\User\BanAppeal::get_status($user_id) : '';
$payload = class_exists('\Jio\User\BanAppeal') ? \Jio\User\BanAppeal::get_payload($user_id) : [];
// 弹窗头(参考主题 edit-header:关闭钮 + gavel 徽标 + 标题居左)。
// 弹窗头:关闭钮 + gavel 徽标 + 标题居左。
$html = '<div class="jio-user-ban-appeal-modal">';
$html .= '<div class="mb10 edit-header touch"><button type="button" class="close" data-jio-modal-close aria-label="' . esc_attr__('关闭', 'jio') . '">' . jio_user_ban_close_svg() . '</button><b class="flex ac c-blue"><span class="toggle-radius mr10 c-blue"><i class="fa fas fa-gavel" aria-hidden="true"></i></span>' . esc_html__('禁封申诉', 'jio') . '</b></div>';
@@ -234,7 +221,7 @@ function jio_get_user_ban_appeal_modal(int $user_id): string
return '<div class="flex"><div class="author-set-left" style="min-width: 80px;">' . esc_html($label) . '</div><div class="author-set-right mt6">' . esc_html($value) . '</div></div>';
};
// 禁封信息行(参考主题申诉弹窗内嵌信息框:用户名/状态/起止时间/原因/说明)。
// 禁封信息行:用户名/状态/起止时间/原因/说明。
$info_box = '<div class="mb10 muted-box padding-10 em09">'
. $set_row(__('用户名', 'jio'), $user->display_name)
. $set_row(__('状态', 'jio'), (string) $info['status'])
@@ -245,7 +232,7 @@ function jio_get_user_ban_appeal_modal(int $user_id): string
. '</div>';
if (!empty($info['no_appeal'])) {
// 禁止申诉态(参考主题:c-yellow box-body + 禁止申诉说明)。
// 禁止申诉态:c-yellow box-body + 禁止申诉说明。
$html .= '<div><div class="c-yellow box-body">' . esc_html__('抱歉!您当前已无法进行申诉', 'jio') . '</div>';
if ((string) $info['no_appeal_desc'] !== '') {
$html .= '<div class="muted-box mt10">' . esc_html((string) $info['no_appeal_desc']) . '</div>';
@@ -262,7 +249,7 @@ function jio_get_user_ban_appeal_modal(int $user_id): string
$input = '';
$footer = '';
if ($status === 'pending') {
// 审核中态(参考主题:黄色 badg + 已提交资料行 + 提交时间)。
// 审核中态:黄色 badg + 已提交资料行 + 提交时间。
$input = '<div class="c-yellow badg block mb6">' . esc_html__('您的申诉正在审核中,请耐心等待', 'jio') . '</div>';
$data = is_array($payload['data'] ?? null) ? $payload['data'] : [];
if (!empty($data)) {
@@ -274,7 +261,7 @@ function jio_get_user_ban_appeal_modal(int $user_id): string
}
$input .= $set_row(__('提交时间', 'jio'), (string) ($payload['time'] ?? ''));
} else {
// 申诉表单(参考主题:资料项逐项输入 + 申诉说明 textarea + 双按钮)。
// 申诉表单:资料项逐项输入 + 申诉说明 textarea + 双按钮。
foreach ((array) $settings['keys'] as $key) {
$key = (string) $key;
if ($key === '') {
@@ -305,8 +292,8 @@ function jio_get_user_ban_appeal_modal(int $user_id): string
}
/**
* 「查看禁封记录」链接(参考主题 zib_get_user_ban_log_link:em09 c-yellow
* 链接触发禁封记录弹窗;仅具备禁封权限的管理员可见)。
* 「查看禁封记录」链接(em09 c-yellow 链接触发禁封记录弹窗;
* 仅具备禁封权限的管理员可见)。
*/
function jio_get_user_ban_log_link(int $user_id, string $class = '', string $con = ''): string
{
@@ -322,9 +309,8 @@ function jio_get_user_ban_log_link(int $user_id, string $class = '', string $con
}
/**
* 禁封记录弹窗(1:1 复刻参考主题 zib_get_ban_log_modal:多彩头 c-yellow +
* 用户行 + 计数 + 逐条记录卡(类型徽章 / 结束时间 / 原因 / 说明 / 禁止申诉);
* 仅具备禁封权限的管理员可见)。
* 禁封记录弹窗(多彩头 c-yellow + 用户行 + 计数 + 逐条记录卡
* (类型徽章 / 结束时间 / 原因 / 说明 / 禁止申诉);仅具备禁封权限的管理员可见)。
*
* @return string 弹窗 HTML(空串 = 无权查看)
*/
@@ -342,7 +328,7 @@ function jio_get_user_ban_log_modal(int $user_id): string
return in_array((string) ($r['type'] ?? ''), ['ban', 'suspend'], true);
}));
// 弹窗头(参考主题 zib_get_modal_colorful_header('c-yellow', ban 图标, 标题))。
// 弹窗头:黄色 colorful header,ban 图标 + 标题。
$html = '<div class="jio-user-ban-log-modal">';
$html .= '<div class="modal-colorful-header colorful-bg c-yellow"><button type="button" class="close" data-jio-modal-close aria-label="' . esc_attr__('关闭', 'jio') . '">' . jio_user_ban_close_svg() . '</button><div class="colorful-make"></div><div class="text-center"><div class="em2x"><i class="fa fas fa-ban" aria-hidden="true"></i></div><div class="mt10 em12 padding-w10">' . esc_html__('禁封记录', 'jio') . '</div></div></div>';
@@ -395,8 +381,7 @@ function jio_get_user_ban_log_modal(int $user_id): string
}
/**
* 受限位置治理提示(评论拒绝态,参考主题 zib_get_user_ban_nocan_info 语义:
* 状态徽章 +「暂时无法操作」+ 查看禁封状态入口)。
* 受限位置治理提示(评论拒绝态:状态徽章 +「暂时无法操作」+ 查看禁封状态入口)。
*
* @param string $msg 具体受阻的操作描述,如「发表评论」。
*/
@@ -418,7 +403,7 @@ function jio_get_user_ban_nocan_html(int $user_id, string $msg = ''): string
}
/**
* 昵称旁禁封徽章(参考主题 user_name_badge 钩子语义:占据 VIP 图标位,
* 昵称旁禁封徽章(占据 VIP 图标位,
* 头像角标 user_avatar_badge 为可选项,见 jio_get_user_ban_avatar_badge)。
*/
function jio_get_user_ban_name_badge(int $user_id): string
@@ -432,7 +417,7 @@ function jio_get_user_ban_name_badge(int $user_id): string
}
/**
* 头像禁封角标(参考主题 user_avatar_badge 钩子语义:覆盖 VIP 角标位)。
* 头像禁封角标(覆盖 VIP 角标位)。
*/
function jio_get_user_ban_avatar_badge(int $user_id): string
{
@@ -446,8 +431,7 @@ function jio_get_user_ban_avatar_badge(int $user_id): string
}
/**
* 登录后禁封状态页(1:1 复刻参考主题 zib_user_ban_restrict_login /
* zib_die_page:红盒提示 + 禁封信息行 + 申诉权限 + 退出登录/申诉按钮)。
* 登录后禁封状态页(红盒提示 + 禁封信息行 + 申诉权限 + 退出登录/申诉按钮)。
* 由 Restriction::restrict_frontend_access() 在 template_redirect 调用。
*/
function jio_render_user_ban_block_page(int $user_id): void
@@ -489,8 +473,7 @@ function jio_render_user_ban_block_page(int $user_id): void
}
/**
* 禁封功能开关(后台“用户&互动 → 禁封/举报 → 禁封功能”,
* 对齐参考主题 _pz('user_ban_s', true):缺键默认开启)。
* 禁封功能开关(后台“用户&互动 → 禁封/举报 → 禁封功能”,缺键默认开启)。
*/
function jio_user_ban_enabled(): bool
{
@@ -502,7 +485,7 @@ function jio_user_ban_enabled(): bool
}
/**
* 当前用户能否禁封目标用户(对齐参考主题 zib_current_user_can('set_user_ban') 语义)。
* 当前用户能否禁封目标用户(需 manage_options 权限,且不能禁封自己 / 超级管理员)。
*/
function jio_current_user_can_ban(int $user_id): bool
{
@@ -535,7 +518,7 @@ function jio_get_user_current_ban(int $user_id): ?array
}
/**
* 禁封 / 解封触发器(参考主题 zib_get_edit_user_ban_link)。
* 禁封 / 解封触发器。
* 输出 data-jio-ban 委托入口,由 assets/js/user-ban.js 打开禁封弹窗。
*/
function jio_get_edit_user_ban_link(int $user_id = 0, string $class = '', string $con = ''): string
@@ -552,7 +535,7 @@ function jio_get_edit_user_ban_link(int $user_id = 0, string $class = '', string
}
/**
* 用户主页封面三点菜单项(参考主题 author_header_drop_lists 钩子语义):
* 用户主页封面三点菜单项:
* 有禁封权限 → 禁封入口;否则(开启举报且非本人)→ 举报入口。
*/
function jio_get_user_cover_menu_action_html(int $user_id): string
@@ -566,9 +549,8 @@ function jio_get_user_cover_menu_action_html(int $user_id): string
}
/**
* 评论三点菜单项(参考主题 comments_action_lists 钩子语义):
* 管理员 → 禁封用户(固定文案,与参考主题 zib_ban_comments_action_lists_filter
* 一致——解封态由弹窗内容呈现);否则 → 举报( Jio 既有评论举报契约)。
* 评论三点菜单项:
* 管理员 → 禁封用户(固定文案,解封态由弹窗内容呈现);否则 → 举报( Jio 既有评论举报契约)。
*/
function jio_get_comment_ban_or_report_item(\WP_Comment $comment): string
{
@@ -583,9 +565,9 @@ function jio_get_comment_ban_or_report_item(\WP_Comment $comment): string
}
/**
* 文章作者资料卡三点菜单项(参考主题 zib_get_post_more_dropdown 语义,菜单首项):
* 文章作者资料卡三点菜单项(菜单首项):
* 管理员 → 禁封用户(固定文案,解封态由弹窗内容呈现);否则 → 空(由既有
* 文章举报项兜底,与参考主题「禁封优先、否则举报」互斥语义一致)。
* 文章举报项兜底,与「禁封优先、否则举报」互斥语义一致)。
*/
function jio_get_post_author_ban_item(int $author_id, string $post_url = ''): string
{
@@ -607,7 +589,7 @@ function jio_user_ban_close_svg(): string
}
/**
* 禁封 / 解封弹窗内容 — 1:1 复刻参考主题 zib_get_set_user_ban_modal:
* 禁封 / 解封弹窗内容:
* 未禁封 → 禁封表单(禁封方式 / 禁封时间 / 预置原因徽章 / 其它原因 /
* 禁封说明 / 删除全部内容 / 禁止用户申诉(含说明));
* 已禁封 → 解封视图(状态信息 + 解封留言表单)。
@@ -623,7 +605,7 @@ function jio_get_user_ban_modal(int $user_id): string
$ban = jio_get_user_current_ban($user_id);
// 用户行(头像 + 昵称),与参考主题弹窗头部同构。
// 用户行(头像 + 昵称)。
$avatar_url = get_avatar_url($user_id, ['size' => 40]);
$user_name = function_exists('jio_get_user_name')
? jio_get_user_name(['id' => $user_id, 'vip' => false, 'medal' => false])
@@ -635,11 +617,11 @@ function jio_get_user_ban_modal(int $user_id): string
$html = '<div class="jio-user-ban-modal">';
if ($ban) {
// ── 已禁封视图:解封(参考主题解封弹窗同构) ──
// ── 已禁封视图:解封 ──
$is_ban = (string) ($ban['type'] ?? '') === 'ban';
$unban_title = $is_ban ? __('解封用户', 'jio') : __('移出小黑屋', 'jio');
// 用户名徽章(参考主题 zib_get_user_name(...&class=inflex ac badg p2-10 em09))。
// 用户名徽章(inflex ac badg p2-10 em09)。
$user_badge = function_exists('jio_get_user_name')
? jio_get_user_name(['id' => $user_id, 'class' => 'inflex ac badg p2-10 em09', 'vip' => false, 'medal' => false, 'auth' => false, 'level' => false])
: '<b>' . esc_html($user->display_name) . '</b>';
@@ -657,7 +639,7 @@ function jio_get_user_ban_modal(int $user_id): string
return '<div class="mb10 flex"><div class="author-set-left" style="min-width: 80px;">' . esc_html($label) . '</div><div class="author-set-right mt6">' . $html_value . '</div></div>';
};
// 禁封记录入口(参考主题:>1 次时展示可点击记录链接,打开禁封记录弹窗)。
// 禁封记录入口:>1 次时展示可点击记录链接,打开禁封记录弹窗。
$log_count = 0;
if (class_exists('\Jio\User\Restriction')) {
$all = \Jio\User\Restriction::get_instance()->get_user_restrictions($user_id, false);
@@ -672,8 +654,8 @@ function jio_get_user_ban_modal(int $user_id): string
? '<div class="mb10 flex"><div class="author-set-left" style="min-width: 80px;">' . esc_html__('禁封记录', 'jio') . '</div><div class="author-set-right mt6">' . $log_link . '</div></div>'
: '';
// 弹窗头(参考主题 zib_get_modal_colorful_header('c-yellow', ban 图标, 标题):
// 120px 多彩横幅 + 大图标 + 居中标题,与禁封视图的 edit-header 头对应)。
// 弹窗头:黄色 colorful header(120px 多彩横幅 + 大图标 + 居中标题,
// 与禁封视图的 edit-header 头对应)。
$html .= '<div class="modal-colorful-header colorful-bg c-yellow"><button type="button" class="close" data-jio-modal-close aria-label="' . esc_attr__('关闭', 'jio') . '">' . jio_user_ban_close_svg() . '</button><div class="colorful-make"></div><div class="text-center"><div class="em2x"><i class="fa fas fa-ban" aria-hidden="true"></i></div><div class="mt10 em12 padding-w10">' . esc_html($unban_title) . '</div></div></div>';
$html .= '<form class="jio-user-ban-form" data-jio-ban-form data-jio-ban-mode="unban" data-jio-ban-user="' . esc_attr((string) $user_id) . '">';
$html .= '<div class="mb20">';
@@ -694,12 +676,11 @@ function jio_get_user_ban_modal(int $user_id): string
return $html;
}
// ── 未禁封视图:禁封表单(参考主题禁封弹窗同构) ──
// ── 未禁封视图:禁封表单 ──
$close_svg = jio_user_ban_close_svg();
$html .= '<div class="mb10 edit-header touch"><button type="button" class="close" data-jio-modal-close aria-label="' . esc_attr__('关闭', 'jio') . '">' . $close_svg . '</button><b class="flex ac c-red"><span class="toggle-radius mr10 c-red"><i class="fa fas fa-ban" aria-hidden="true"></i></span>' . esc_html__('禁封用户', 'jio') . '</b></div>';
// 历史禁封次数提示(1:1 参考主题 zib_get_set_user_ban_modal:>1 次时
// 展示「禁封记录」行 + 可点击的黄链(打开禁封记录弹窗))。
// 历史禁封次数提示:>1 次时展示「禁封记录」行 + 可点击的黄链(打开禁封记录弹窗)。
$log_count = 0;
if (class_exists('\Jio\User\Restriction')) {
$all = \Jio\User\Restriction::get_instance()->get_user_restrictions($user_id, false);
@@ -729,7 +710,7 @@ function jio_get_user_ban_modal(int $user_id): string
$html .= '<div data-jio-ban-desc="2" style="display:none;">' . esc_html__('禁封的用户将不能登录', 'jio') . '</div>';
$html .= '</div>';
// 禁封时间(1/7/14/30/100/永久,默认 7 天,对齐参考主题 checked(7, ...))。
// 禁封时间(1/7/14/30/100/永久,默认 7 天)。
$html .= '<div class="muted-2-color mb6">' . esc_html__('禁封时间', 'jio') . '</div>';
$html .= '<div class="form-radio mb10 form-but-radio">';
foreach ([1 => __('1天', 'jio'), 7 => __('7天', 'jio'), 14 => __('14天', 'jio'), 30 => __('30天', 'jio'), 100 => __('100天', 'jio'), 0 => __('永久', 'jio')] as $days => $label) {
@@ -2,8 +2,7 @@
/**
* Affiliate poster preview modal.
*
* 1:1 replica of the reference theme's poster-share modal (zibll js/poster-share.js
* + css/main.css `.poster-share` block): a borderless 360px Bootstrap-style dialog
* Poster-share modal: a borderless 360px Bootstrap-style dialog
* centred by `.modal.flex.jc`, a `.loading-mask` overlay while the canvas renders,
* and circular download/close buttons on a `.hover-show-con` layer that only fades
* in on hover. The 推广海报 button lives in the revenue detail link row; the QR code
@@ -64,7 +64,7 @@ $points_signin_label = sprintf(__('签到领%s', 'jio'), $currency);
</div>
<?php if ($points_exchange_on) :
// 购买积分弹窗 — Zibll zibpay_get_points_pay_modal 1:1(商品盒 / 自定义 / 支付方式含卡密 / 立即支付)。
// 购买积分弹窗(商品盒 / 自定义 / 支付方式含卡密 / 立即支付)。
$pb_rate = max(1, (int) ($points_exchange['rate'] ?? 100));
$pb_min_points = max(1, (int) ($points_exchange['min_points'] ?? 100));
$pb_daily_max_points = max(1, (int) ($points_exchange['daily_max_points'] ?? 100000));
@@ -109,7 +109,7 @@ $points_signin_label = sprintf(__('签到领%s', 'jio'), $currency);
<?php if ($points_packages) : ?>
<div class="muted-color mb6"><?php printf(esc_html__('请选择需购买的%s', 'jio'), esc_html($currency)); ?></div>
<?php foreach ($points_packages as $pidx => $ppkg) : ?>
<div class="zib-widget vip-product relative product-box<?php echo $pidx === 0 ? ' active' : ''; ?>" data-for="points_product" data-value="<?php echo esc_attr((string) $ppkg['key']); ?>">
<div class="jio-widget-box vip-product relative product-box<?php echo $pidx === 0 ? ' active' : ''; ?>" data-for="points_product" data-value="<?php echo esc_attr((string) $ppkg['key']); ?>">
<?php if (!empty($ppkg['tag'])) : ?>
<div class="abs-right vip-tag badg jb-yellow"><?php echo esc_html((string) $ppkg['tag']); ?></div>
<?php endif; ?>
@@ -100,7 +100,7 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
<?php endif; ?>
</div>
<!-- Charge modal — Zibll balance-charge modal 1:1 (refresh_modal shell + zibpay_get_balance_charge_modal) -->
<!-- Charge modal — balance-charge modal (refresh_modal shell) -->
<?php
$charge_method_logos = [
'balance' => 'pay-balance-logo.svg',
@@ -124,7 +124,7 @@ $charge_mark_html = $charge_mark_symbol
? '<span class="px12">' . esc_html($mark) . '</span>'
: '';
$charge_unit = $charge_mark_symbol ? '' : (string) $mark;
// 与 Zibll 格式对齐(mark 前缀:最低充值¥1);mark 配置为单位(元)时用后缀:最低充值1元。
// 充值额度文案(mark 前缀:最低充值¥1);mark 配置为单位(元)时用后缀:最低充值1元。
$charge_limit_html = $charge_mark_symbol
? sprintf(__('最低充值%1$s1,最高充值%1$s%2$s', 'jio'), $mark, $custom_limit)
: sprintf(__('最低充值1%1$s,最高充值%2$s%1$s', 'jio'), $charge_unit, $custom_limit);
@@ -156,7 +156,7 @@ $charge_custom_block = static function () use ($mark, $charge_mark_html, $charge
$package_pay = $normalize_balance($pkg['pay_price'] ?? '');
$package_saving_minor = max(0, $package_credit->minor() - $package_pay->minor());
?>
<div class="zib-widget vip-product relative product-box<?php echo $idx === 0 ? ' active' : ''; ?>" data-for="balance_product" data-value="<?php echo esc_attr((string) $pkg['key']); ?>">
<div class="jio-widget-box vip-product relative product-box<?php echo $idx === 0 ? ' active' : ''; ?>" data-for="balance_product" data-value="<?php echo esc_attr((string) $pkg['key']); ?>">
<?php if (!empty($pkg['tag'])) : ?>
<div class="abs-right vip-tag badg jb-yellow"><?php echo esc_html((string) $pkg['tag']); ?></div>
<?php endif; ?>
@@ -14,14 +14,14 @@ $info = is_array($snapshot['info'] ?? null) ? $snapshot['info'] : [];
$application = is_array($snapshot['application'] ?? null) ? $snapshot['application'] : [];
$status = (string) ($snapshot['status'] ?? '');
$can_apply = !empty($snapshot['can_apply']);
$auth_icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-user-auth') : '<i class="fa fas fa-id-badge" aria-hidden="true"></i>';
$close_icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-close', 'ic-close') : '<i class="fa fas fa-times" aria-hidden="true"></i>';
$auth_icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-user-auth') : '<i class="fa fas fa-id-badge" aria-hidden="true"></i>';
$close_icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-close', 'ic-close') : '<i class="fa fas fa-times" aria-hidden="true"></i>';
$config = [
'restBase' => untrailingslashit(rest_url('jio/v1/identity/applications')),
'nonce' => wp_create_nonce('wp_rest'),
];
?>
<div class="colorful-bg c-blue flex jc zib-widget" style="padding: 40px 20px;" data-identity-root data-identity-config="<?php echo esc_attr(wp_json_encode($config)); ?>">
<div class="colorful-bg c-blue flex jc jio-widget-box" style="padding: 40px 20px;" data-identity-root data-identity-config="<?php echo esc_attr(wp_json_encode($config)); ?>">
<div class="colorful-make"></div>
<div class="text-center">
<div class="em4x"><?php echo $auth_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
@@ -47,8 +47,8 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
</h1>
<div class="uc-header__meta desc user-identity flex ac hh">
<?php
// 治理状态入口(参考主题 user_page_header_desc 钩子 / zib_get_user_ban_info_link:
// 用户中心「封禁」元信息,点击打开查看禁封状态弹窗 → 申诉弹窗)。
// 治理状态入口:用户中心「封禁」元信息,
// 点击打开查看禁封状态弹窗 → 申诉弹窗。
if (function_exists('jio_get_user_ban_info_link')) {
echo jio_get_user_ban_info_link((int) $user_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- helper escapes internally.
}
@@ -50,7 +50,7 @@ $percentage = max(0, min(100, (int) ($progress['progress'] ?? 0)));
<div class="jio-level-page">
<div class="row jio-level-page__summary">
<div class="col-md-5">
<section class="zib-widget colorful-bg jb-vip1 jio-level-card jio-level-card--summary">
<section class="jio-widget-box colorful-bg jb-vip1 jio-level-card jio-level-card--summary">
<div class="colorful-make" aria-hidden="true"></div>
<div class="jio-level-card__summary-inner">
<div class="jio-level-card__identity">
@@ -73,7 +73,7 @@ $percentage = max(0, min(100, (int) ($progress['progress'] ?? 0)));
</section>
</div>
<div class="col-md-7">
<section class="zib-widget colorful-bg c-gray jio-level-card jio-level-card--growth">
<section class="jio-widget-box colorful-bg c-gray jio-level-card jio-level-card--growth">
<div class="colorful-make" aria-hidden="true"></div>
<div class="jio-level-card__growth-inner">
<div class="jio-level-card__growth-head">
@@ -107,7 +107,7 @@ $percentage = max(0, min(100, (int) ($progress['progress'] ?? 0)));
</div>
</div>
<section class="zib-widget jio-level-experience">
<section class="jio-widget-box jio-level-experience">
<div class="box-body">
<div class="jio-level-tabs" role="tablist" aria-label="<?php esc_attr_e('经验记录', 'jio'); ?>">
<a id="tab-integral-get" class="but mr6 is-active" data-jio-level-tab="tab_integral_get" href="#tab_integral_get" role="tab" aria-controls="tab_integral_get" aria-selected="true"><?php esc_html_e('获取经验值', 'jio'); ?></a>
@@ -15,7 +15,7 @@ require __DIR__ . '/sidebar-vip.php';
require __DIR__ . '/sidebar-commerce.php';
require __DIR__ . '/sidebar-creator.php';
require __DIR__ . '/sidebar-nav.php';
$drawer_trigger_icon = jio_icon_markup('zibsvg-menu');
$drawer_trigger_icon = jio_icon_markup('jiosvg-menu');
?>
<button type="button" class="uc-sidebar__drawer-trigger" id="uc-drawer-trigger" aria-label="<?php esc_attr_e('打开导航', 'jio'); ?>">
<?php echo $drawer_trigger_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
@@ -25,7 +25,7 @@ $can_recover_password = $sign_in_available && ($reset_channel === 'email_phone'
: ($reset_channel === 'phone' ? $account_phone !== '' : $account_email !== ''));
$recovery_target = $reset_channel === 'phone' ? $account_phone : ($account_email !== '' ? $account_email : $account_phone);
$recovery_channel = $reset_channel === 'email_phone' ? '' : $reset_channel;
$account_close_icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-close', 'ic-close') : '<i class="fa fas fa-times" aria-hidden="true"></i>';
$account_close_icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-close', 'ic-close') : '<i class="fa fas fa-times" aria-hidden="true"></i>';
$render_row = static function (string $icon, string $title, string $value, string $action, string $modal, string $icon_tone, string $action_tone, bool $interactive = true): void {
?>
@@ -26,8 +26,8 @@ foreach ((array) ($oauth_data['bindings'] ?? []) as $binding) {
if (!$key) {
continue;
}
// Reference parity: the provider type (clogin_ prefix stripped) drives the
// .social-login-item brand colour, matching zibll's binding list.
// The provider type (clogin_ prefix stripped) drives the
// .social-login-item brand colour.
$icon_type = str_starts_with($key, 'clogin_') ? substr($key, 7) : $key;
$binding_rows[$key] = [
'key' => $key,
@@ -20,9 +20,9 @@ try {
$wallet = '0.00';
}
$points = max(0, (int) ($credit_balance ?? 0));
$wallet_icon = jio_icon_markup('zibsvg-money-color-2');
$points_icon = jio_icon_markup('zibsvg-points-color');
$arrow_icon = jio_icon_markup('zibsvg-right');
$wallet_icon = jio_icon_markup('jiosvg-money-color-2');
$points_icon = jio_icon_markup('jiosvg-points-color');
$arrow_icon = jio_icon_markup('jiosvg-right');
?>
<div class="uc-sidebar__pair uc-sidebar__pair--assets">
<?php if ($show_wallet) : ?>
@@ -2,9 +2,8 @@
/**
* User center sidebar: creator center / promotion center cards.
*
* 1:1 port of the reference theme zib_user_center_page_sidebar_income_rebate():
* two zib-widget cards, each with an icon title row and two centered stats.
* Navigation keeps the Jio <a href data-tab> contract instead of the reference click proxy.
* Two jio-widget-box cards, each with an icon title row and two centered stats.
* Navigation uses the Jio <a href data-tab> contract.
*
* @package Jio
*/
@@ -36,7 +35,7 @@ if ($creation_url !== '') {
$centers[] = [
'url' => $creation_url,
'tab' => 'creator',
'icon' => jio_icon_markup('zibsvg-merchant-color', 'mr6'),
'icon' => jio_icon_markup('jiosvg-merchant-color', 'mr6'),
'title' => __('创作中心', 'jio'),
'first' => jio_cut_count($cash_income),
'first_l' => __('现金收益', 'jio'),
@@ -64,7 +63,7 @@ if ($revenue_url !== '') {
$centers[] = [
'url' => $revenue_url,
'tab' => 'revenue',
'icon' => jio_icon_markup('zibsvg-money-color', 'mr6'),
'icon' => jio_icon_markup('jiosvg-money-color', 'mr6'),
'title' => __('推广中心', 'jio'),
'first' => $rebate_ratio . '%',
'first_l' => __('比例', 'jio'),
@@ -75,7 +74,7 @@ if ($revenue_url !== '') {
?>
<div class="uc-sidebar-centers flex ab jsb col-ml6<?php echo $user_id <= 0 ? ' signin-loader' : ''; ?>">
<?php foreach ($centers as $center) : ?>
<a style="flex: 1;" class="mb10-sm zib-widget padding-10 flex1 pointer" href="<?php echo esc_url($center['url']); ?>" data-tab="<?php echo esc_attr($center['tab']); ?>">
<a style="flex: 1;" class="mb10-sm jio-widget-box padding-10 flex1 pointer" href="<?php echo esc_url($center['url']); ?>" data-tab="<?php echo esc_attr($center['tab']); ?>">
<div class="muted-color em09 mb6 flex ac"><div class="overflow-hidden"><div class="text-ellipsis"><?php echo $center['icon']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><?php echo esc_html($center['title']); ?></div></div><i class="ml6 fa fas fa-angle-right em12" aria-hidden="true"></i></div>
<div class="flex jsa text-center"><div class=""><div class="font-bold em12"><?php echo esc_html($center['first']); ?></div><div class="px12 opacity5"><?php echo esc_html($center['first_l']); ?></div></div><div class="overflow-hidden"><div class="font-bold em12"><?php echo esc_html($center['second']); ?></div><div class="px12 opacity5 text-ellipsis"><?php echo esc_html($center['second_l']); ?></div></div></div>
</a>
@@ -19,7 +19,7 @@ $orders_url = $orders_available ? (string) ($orders_url ?? '') : '';
$tickets_available = isset($dashboard_tabs['tickets']);
$tickets_url = $tickets_available ? jio_get_user_center_tab_url('tickets') : '';
// 参考主题由 zibpay 把「我的订单」前插到按钮组最前,其后才是等级 / 认证。
// 「我的订单」位于按钮组最前,其后才是等级 / 认证。
$services = array_values(array_filter([
[
'label' => __('我的订单', 'jio'),
@@ -74,7 +74,7 @@ $render_grid = static function (array $items): void {
<?php foreach ($items as $item) :
$tab = (string) ($item['tab'] ?? '');
$item_class = 'icon-but-' . ($tab !== '' ? $tab : 'item');
$icon_html = jio_icon_markup('zibsvg-' . (string) $item['icon']);
$icon_html = jio_icon_markup('jiosvg-' . (string) $item['icon']);
?>
<a class="<?php echo esc_attr($item_class); ?>" href="<?php echo esc_url((string) $item['url']); ?>"<?php if ($tab !== '') : ?> data-tab="<?php echo esc_attr($tab); ?>"<?php endif; ?>>
<div class="em16"><?php echo $icon_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
@@ -86,14 +86,14 @@ $render_grid = static function (array $items): void {
};
?>
<?php if ($services) : ?>
<div class="uc-sidebar-iconbox zib-widget padding-6 mb10-sm">
<div class="uc-sidebar-iconbox jio-widget-box padding-6 mb10-sm">
<div class="padding-6 ml3"><?php esc_html_e('我的服务', 'jio'); ?></div>
<?php $render_grid($services); ?>
</div>
<?php endif; ?>
<?php if ($settings) : ?>
<div class="uc-sidebar-iconbox zib-widget padding-6">
<div class="uc-sidebar-iconbox jio-widget-box padding-6">
<div class="padding-6 ml3"><?php esc_html_e('功能设置', 'jio'); ?></div>
<?php $render_grid($settings); ?>
</div>
@@ -34,8 +34,8 @@ $stats = [
],
];
?>
<?php // 1:1 参考主题 zib_user_center_page_sidebar_statistics():单张 zib-widget,四项 space-around 平铺。 ?>
<div class="uc-sidebar-statistics mb10-sm mb20 flex ac jsa zib-widget padding-10 text-center" aria-label="<?php esc_attr_e('账号统计', 'jio'); ?>">
<?php // 单张 jio-widget-box,四项 space-around 平铺。 ?>
<div class="uc-sidebar-statistics mb10-sm mb20 flex ac jsa jio-widget-box padding-10 text-center" aria-label="<?php esc_attr_e('账号统计', 'jio'); ?>">
<?php foreach ($stats as $stat) : ?>
<a class="user-statistics-item" href="<?php echo esc_url((string) $stat['url']); ?>"<?php if (!empty($stat['tab'])) : ?> data-tab="<?php echo esc_attr((string) $stat['tab']); ?>"<?php endif; ?>><div class="em14"><?php echo esc_html(jio_cut_count((int) $stat['value'])); ?></div><div class="em09 opacity5 mt6"><?php echo esc_html((string) $stat['label']); ?></div></a>
<?php endforeach; ?>
@@ -2,10 +2,9 @@
/**
* User center sidebar: VIP entry.
*
* 1:1 port of the reference theme zib_user_center_page_sidebar_vip():
* metallic payvip-icon bar, level icon + name + expiry badge for members,
* Metallic payvip-icon bar, level icon + name + expiry badge for members,
* vip_1 icon + "开通会员 尊享会员权益" otherwise, chevron pinned right.
* Navigation keeps the Jio <a href data-tab> contract instead of the reference click proxy.
* Navigation uses the Jio <a href data-tab> contract.
*
* @package Jio
*/
@@ -27,7 +26,7 @@ $vip_url = jio_get_user_center_tab_url('vip');
if ($vip_level > 0) {
$vip_name = (string) ($vip_levels[$vip_level]['name_html'] ?? $vip_levels[$vip_level]['name'] ?? ('VIP' . $vip_level));
// Same semantics as zib_get_user_vip_exp_date_text(): date / 会员已过期 / 永久会员,
// Expiry badge: date / 会员已过期 / 永久会员,
// and no badge at all when there is no expiry data.
$expires = max(0, (int) ($vip_state['expires'] ?? 0));
$exp_label = '';
@@ -41,11 +40,11 @@ if ($vip_level > 0) {
. '<span>' . wp_kses_post($vip_name) . '</span>';
if ($exp_label !== '') {
$button .= '<span class="ml10 badg jb-yellow vip-expdate-tag">'
. jio_icon_markup('zibsvg-time', 'mr3')
. jio_icon_markup('jiosvg-time', 'mr3')
. esc_html($exp_label) . '</span>';
}
} else {
$button = jio_icon_markup('zibsvg-vip_1', 'em12 mr6') . esc_html__('开通会员 尊享会员权益', 'jio');
$button = jio_icon_markup('jiosvg-vip_1', 'em12 mr6') . esc_html__('开通会员 尊享会员权益', 'jio');
}
$vip_class = 'uc-sidebar-vip mb20 mb10-sm main-radius payvip-icon btn-block badg pointer' . ($user_id <= 0 ? ' signin-loader' : '');
@@ -118,7 +118,7 @@ foreach ([1, 2] as $lv) {
: '';
$cta = __('开通', 'jio') . wp_kses_post($lv_name);
$vip_attr = $lv;
// 参考主题 zibpay_get_vip_card:续费/升级档位卡展示各自的一句话简介。
// 续费/升级档位卡展示各自的一句话简介。
$card_action = 'pay';
$card_desc = $lv_desc;
$lv_icon_url = esc_url((string) ($levels[$lv]['img_icon'] ?? ''));
@@ -182,8 +182,8 @@ foreach ([1, 2] as $lv) {
</div>
<?php
// 积分兑换会员入口(参考主题 zibpay_user_page_tab_content_vip 1:1:档位购买卡
// 下方的全宽横条;仅非会员 + 积分兑换开启 + 有可兑换套餐时输出)。
// 积分兑换会员入口(档位购买卡下方的全宽横条;
// 仅非会员 + 积分兑换开启 + 有可兑换套餐时输出)。
echo jio_get_vip_points_exchange_entry_html($user_id, $level); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- 各字段已在生成时转义。
?>
</div>