refactor: rename the theme brand and every identifier from AKSRT to Jio

Full-project rename. `git grep -i aksrt` is now empty apart from the
DBMigrator 3.3.0 changelog note that documents the rename itself.

Code identifiers
- PHP namespace AKSRT\ -> Jio\ (composer PSR-4 + 378 declarations)
- global constants AKSRT_* -> JIO_* (VERSION/DIR/URI, PAY_TYPE_*, CAPTCHA_*)
- procedural functions, hooks, options, meta keys, table names,
  cookies, query vars, ajax actions and nonces: aksrt_ -> jio_
- text domain aksrt -> jio; Theme Name -> Jio
- JS globals: aksrtData/aksrtAdminData/... -> jioData/jioAdminData/...,
  window.AKSRTCaptcha & friends -> window.JioCaptcha, Aksrt* -> Jio*
- Vue components Aks*.vue -> Jio*.vue (15 files renamed + imports)
- CSS classes/data-attrs/custom properties: aksrt- -> jio-
- REST namespace aksrt/v1 -> jio/v1 (incl. payment gateway callbacks)

Storage layer
- DB tables {prefix}aksrt_* -> {prefix}jio_*; SCHEMA_VERSION 3.2.0 -> 3.3.0
  so dbDelta creates the new names on install
- widget id_base aksrt_widget_* -> jio_widget_*
- uninstall.php drop list rebuilt from the actual migrator tables
  (dropped 3 stale entries, added the 17 missing ones)

Removed
- hardcoded https://api.aksrt.com/version.json default update endpoint;
  get_endpoint() now reads the 「更新端点」 setting and do_check() no-ops
  when it is empty

Files renamed: inc/helpers/aksrt-*.php -> jio-*.php (54),
assets/admin/src/components/form/Aks*.vue -> Jio*.vue (15).
Build artifacts regenerated: assets/css/build, assets/js/runtime,
assets/admin/build.

Verified: audit-psr4-paths errors=0, audit-admin-contracts errors=0
(warnings=56, unchanged baseline), 813/813 widget-system tests,
44/44 phpunit, php -l clean across all PHP.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Opus 5 committed 2026-11-01 20:05:04 +08:00
1 parent 5b16bc6e15
commit 35bb96e82f
997 files changed
+28216 -28188

No files matched your search

+31 -31
View File
@@ -2,21 +2,21 @@
/**
* Comment action permissions + like/pin primitives.
*
* Extracted from aksrt-frontend-tags.php for size budget.
* Extracted from jio-frontend-tags.php for size budget.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_comment_action_permissions')) :
if (!function_exists('jio_comment_action_permissions')) :
/**
* Single source of truth for per-comment action permissions.
*
* @param WP_Comment|int $comment Comment object or ID.
* @return array{can_edit:bool,can_delete:bool,can_moderate:bool,can_pin:bool}
*/
function aksrt_comment_action_permissions($comment): array {
function jio_comment_action_permissions($comment): array {
$comment = $comment instanceof WP_Comment ? $comment : get_comment($comment);
$none = ['can_edit' => false, 'can_delete' => false, 'can_moderate' => false, 'can_pin' => false];
if (!($comment instanceof WP_Comment) || !is_user_logged_in()) {
@@ -31,19 +31,19 @@ if (!function_exists('aksrt_comment_action_permissions')) :
$ctx = $post_id > 0 ? $post_id : null;
$can = static function (string $cap) use ($uid, $ctx): bool {
if (function_exists('aksrt_user_can')) {
return aksrt_user_can($cap, $uid, $ctx);
if (function_exists('jio_user_can')) {
return jio_user_can($cap, $uid, $ctx);
}
if (class_exists('\AKSRT\Settings\Capabilities')) {
return \AKSRT\Settings\Capabilities::user_can($cap, $uid, $ctx);
if (class_exists('\Jio\Settings\Capabilities')) {
return \Jio\Settings\Capabilities::user_can($cap, $uid, $ctx);
}
return false;
};
// 允许用户编辑评论:参考主题 user_edit_comment 总开关(关闭后本人亦不可编辑)。
$user_edit = true;
if (class_exists('\AKSRT\Settings\Settings')) {
$display = \AKSRT\Settings\Settings::get_comment_display_settings();
if (class_exists('\Jio\Settings\Settings')) {
$display = \Jio\Settings\Settings::get_comment_display_settings();
$user_edit = !isset($display['user_edit']) || !empty($display['user_edit']);
}
@@ -71,20 +71,20 @@ if (!function_exists('aksrt_comment_action_permissions')) :
}
endif;
if (!function_exists('aksrt_is_comment_pinned')) :
if (!function_exists('jio_is_comment_pinned')) :
/**
* @param int|WP_Comment $comment Comment.
*/
function aksrt_is_comment_pinned($comment): bool {
function jio_is_comment_pinned($comment): bool {
$comment_id = $comment instanceof WP_Comment ? (int) $comment->comment_ID : (int) $comment;
if ($comment_id <= 0) {
return false;
}
return '1' === (string) get_comment_meta($comment_id, '_aksrt_comment_pinned', true);
return '1' === (string) get_comment_meta($comment_id, '_jio_comment_pinned', true);
}
endif;
if (!function_exists('aksrt_update_comment_counter')) :
if (!function_exists('jio_update_comment_counter')) :
/**
* Atomically bump a numeric comment-meta counter, floored at zero.
*
@@ -93,7 +93,7 @@ if (!function_exists('aksrt_update_comment_counter')) :
* @param int $delta Signed delta.
* @return int Latest value (>= 0).
*/
function aksrt_update_comment_counter($comment_id, $meta_key, $delta) {
function jio_update_comment_counter($comment_id, $meta_key, $delta) {
global $wpdb;
$comment_id = (int) $comment_id;
$delta = (int) $delta;
@@ -119,51 +119,51 @@ if (!function_exists('aksrt_update_comment_counter')) :
}
endif;
if (!function_exists('aksrt_get_comment_likes')) :
if (!function_exists('jio_get_comment_likes')) :
/**
* @param int|WP_Comment $comment Comment.
*/
function aksrt_get_comment_likes($comment): int {
function jio_get_comment_likes($comment): int {
$comment_id = $comment instanceof WP_Comment ? (int) $comment->comment_ID : (int) $comment;
if ($comment_id <= 0) {
return 0;
}
return max(0, (int) get_comment_meta($comment_id, 'aksrt_comment_likes', true));
return max(0, (int) get_comment_meta($comment_id, 'jio_comment_likes', true));
}
endif;
if (!function_exists('aksrt_is_comment_liked')) :
if (!function_exists('jio_is_comment_liked')) :
/**
* @param int $comment_id Comment ID.
*/
function aksrt_is_comment_liked($comment_id): bool {
function jio_is_comment_liked($comment_id): bool {
$comment_id = (int) $comment_id;
if ($comment_id <= 0) {
return false;
}
if (is_user_logged_in()) {
$liked = get_user_meta(get_current_user_id(), '_aksrt_liked_comments', true);
$liked = get_user_meta(get_current_user_id(), '_jio_liked_comments', true);
$liked = is_array($liked) ? array_map('intval', $liked) : [];
return in_array($comment_id, $liked, true);
}
$cookie = 'aksrt_clike_' . $comment_id;
$cookie = 'jio_clike_' . $comment_id;
return !empty($_COOKIE[$cookie]) && '1' === $_COOKIE[$cookie];
}
endif;
if (!function_exists('aksrt_set_comment_like_state')) :
if (!function_exists('jio_set_comment_like_state')) :
/**
* @param int $comment_id Comment ID.
* @param bool $active Target state.
*/
function aksrt_set_comment_like_state($comment_id, $active): void {
function jio_set_comment_like_state($comment_id, $active): void {
$comment_id = (int) $comment_id;
if ($comment_id <= 0) {
return;
}
if (is_user_logged_in()) {
$user_id = get_current_user_id();
$liked = get_user_meta($user_id, '_aksrt_liked_comments', true);
$liked = get_user_meta($user_id, '_jio_liked_comments', true);
$liked = is_array($liked) ? array_map('intval', $liked) : [];
if ($active) {
$liked[] = $comment_id;
@@ -172,10 +172,10 @@ if (!function_exists('aksrt_set_comment_like_state')) :
return (int) $id !== $comment_id;
});
}
update_user_meta($user_id, '_aksrt_liked_comments', array_values(array_unique($liked)));
update_user_meta($user_id, '_jio_liked_comments', array_values(array_unique($liked)));
return;
}
$cookie = 'aksrt_clike_' . $comment_id;
$cookie = 'jio_clike_' . $comment_id;
$path = defined('COOKIEPATH') && COOKIEPATH ? COOKIEPATH : '/';
$domain = defined('COOKIE_DOMAIN') ? COOKIE_DOMAIN : '';
setcookie($cookie, $active ? '1' : '', $active ? time() + YEAR_IN_SECONDS : time() - HOUR_IN_SECONDS, $path, $domain, is_ssl(), true);
@@ -187,7 +187,7 @@ if (!function_exists('aksrt_set_comment_like_state')) :
}
endif;
if (!function_exists('aksrt_reorder_pinned_comments')) :
if (!function_exists('jio_reorder_pinned_comments')) :
/**
* Float pinned top-level comments to the front of the queried list.
*
@@ -195,14 +195,14 @@ if (!function_exists('aksrt_reorder_pinned_comments')) :
* @param int $post_id Post ID.
* @return array
*/
function aksrt_reorder_pinned_comments($comments, $post_id) {
function jio_reorder_pinned_comments($comments, $post_id) {
if (!is_array($comments) || count($comments) < 2) {
return $comments;
}
$pinned = [];
$normal = [];
foreach ($comments as $comment) {
if ($comment instanceof WP_Comment && (int) $comment->comment_parent === 0 && aksrt_is_comment_pinned($comment)) {
if ($comment instanceof WP_Comment && (int) $comment->comment_parent === 0 && jio_is_comment_pinned($comment)) {
$pinned[] = $comment;
} else {
$normal[] = $comment;
@@ -215,4 +215,4 @@ if (!function_exists('aksrt_reorder_pinned_comments')) :
}
endif;
add_filter('comments_array', 'aksrt_reorder_pinned_comments', 20, 2);
add_filter('comments_array', 'jio_reorder_pinned_comments', 20, 2);
+5 -5
View File
@@ -4,22 +4,22 @@
*
* Supports [img=url] and [code]...[/code].
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_render_comment_content')) :
if (!function_exists('jio_render_comment_content')) :
/**
* Filter comment body: images and code blocks (legacy parity).
*/
function aksrt_render_comment_content(string $content): string {
function jio_render_comment_content(string $content): string {
// [img=url]
$rendered = preg_replace_callback(
'/\[img=(https?:\/\/[^\s\[\]]+)\]/i',
static function (array $matches): string {
return '<img' . aksrt_get_lazy_attr('lazy_comment', (string) $matches[1], 'box-img comment-inline-img', aksrt_get_lazy_thumb('lg'))
. ' alt="' . esc_attr__('评论图片', 'aksrt') . '" decoding="async">';
return '<img' . jio_get_lazy_attr('lazy_comment', (string) $matches[1], 'box-img comment-inline-img', jio_get_lazy_thumb('lg'))
. ' alt="' . esc_attr__('评论图片', 'jio') . '" decoding="async">';
},
$content
);
+26 -26
View File
@@ -5,12 +5,12 @@
* Mirrors legacy() and legacy()
* from legacy/inc/functions.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_get_comment_virtual_input_html')) :
if (!function_exists('jio_get_comment_virtual_input_html')) :
/**
* Mobile virtual input bar (legacy: legacy).
*
@@ -18,24 +18,24 @@ if (!function_exists('aksrt_get_comment_virtual_input_html')) :
* @param string $target CSS selector for the FixedInput target.
* @return string
*/
function aksrt_get_comment_virtual_input_html(string $placeholder = '', string $target = '#respond'): string {
function jio_get_comment_virtual_input_html(string $placeholder = '', string $target = '#respond'): string {
$user_id = get_current_user_id();
$avatar = get_avatar($user_id, 36, '', '', ['class' => 'avatar']);
if ($placeholder === '') {
$placeholder = __('说点什么吧...', 'aksrt');
$placeholder = __('说点什么吧...', 'jio');
}
$html = '<div class="flex ac jsb virtual-input" fixed-input="' . esc_attr($target) . '">';
$html .= '<div class="flex flex1 ac">';
$html .= $avatar;
$html .= '<div class="text-ellipsis simulation mr10">' . esc_html($placeholder) . '</div>';
$html .= '</div>';
$html .= '<span class="but c-blue">' . esc_html__('提交', 'aksrt') . '</span>';
$html .= '<span class="but c-blue">' . esc_html__('提交', 'jio') . '</span>';
$html .= '</div>';
return $html;
}
endif;
if (!function_exists('aksrt_get_input_expand_but')) :
if (!function_exists('jio_get_input_expand_but')) :
/**
* legacy-style expand toolbar button + dropdown (legacy: legacy).
*
@@ -44,56 +44,56 @@ if (!function_exists('aksrt_get_input_expand_but')) :
* @param array<string,mixed> $ctx Optional context (upload).
* @return string
*/
function aksrt_get_input_expand_but(string $type, $arg1 = null, array $ctx = []): string {
function jio_get_input_expand_but(string $type, $arg1 = null, array $ctx = []): string {
$but = '';
$dropdown = '';
switch ($type) {
case 'link':
$but = '<a class="but btn-input-expand input-link mr6" href="javascript:;"><i class="fa fas fa-fw fa-link" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('链接', 'aksrt') . '</span></a>';
$but = '<a class="but btn-input-expand input-link mr6" href="javascript:;"><i class="fa fas fa-fw fa-link" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('链接', 'jio') . '</span></a>';
$dropdown = '<div class="dropdown-link">';
$dropdown .= '<p>' . esc_html__('请输入链接:', 'aksrt') . '</p>';
$dropdown .= '<p>' . esc_html__('请输入链接:', 'jio') . '</p>';
$dropdown .= '<p><textarea rows="2" tabindex="1" class="form-control input-textarea link-textarea" style="height:55px;" placeholder="https://..."></textarea></p>';
$dropdown .= '<p><input type="text" class="form-control link-text" placeholder="' . esc_attr__('链接文本', 'aksrt') . '"></p>';
$dropdown .= '<div class="text-right"><a type="submit" class="but c-blue pw-1em input-link-submit" href="javascript:;">' . esc_html__('确认', 'aksrt') . '</a></div>';
$dropdown .= '<p><input type="text" class="form-control link-text" placeholder="' . esc_attr__('链接文本', 'jio') . '"></p>';
$dropdown .= '<div class="text-right"><a type="submit" class="but c-blue pw-1em input-link-submit" href="javascript:;">' . esc_html__('确认', 'jio') . '</a></div>';
$dropdown .= '</div>';
break;
case 'code':
$but = '<a class="but btn-input-expand input-code mr6" href="javascript:;"><i class="fa fas fa-fw fa-code" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('代码', 'aksrt') . '</span></a>';
$but = '<a class="but btn-input-expand input-code mr6" href="javascript:;"><i class="fa fas fa-fw fa-code" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('代码', 'jio') . '</span></a>';
$dropdown = '<div class="dropdown-code">';
$dropdown .= '<p>' . esc_html__('请输入代码:', 'aksrt') . '</p>';
$dropdown .= '<p><textarea rows="6" tabindex="1" class="form-control input-textarea" placeholder="' . esc_attr__('在此处粘贴或输入代码', 'aksrt') . '"></textarea></p>';
$dropdown .= '<div class="text-right"><a type="submit" class="but c-blue pw-1em input-code-submit" href="javascript:;">' . esc_html__('确认', 'aksrt') . '</a></div>';
$dropdown .= '<p>' . esc_html__('请输入代码:', 'jio') . '</p>';
$dropdown .= '<p><textarea rows="6" tabindex="1" class="form-control input-textarea" placeholder="' . esc_attr__('在此处粘贴或输入代码', 'jio') . '"></textarea></p>';
$dropdown .= '<div class="text-right"><a type="submit" class="but c-blue pw-1em input-code-submit" href="javascript:;">' . esc_html__('确认', 'jio') . '</a></div>';
$dropdown .= '</div>';
break;
case 'image':
$upload = !empty($arg1) || !empty($ctx['upload']);
$upload_id = 'comment';
$but = '<a class="but btn-input-expand input-image mr6" href="javascript:;"><i class="fa fas fa-fw fa-image" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('图片', 'aksrt') . '</span></a>';
$but = '<a class="but btn-input-expand input-image mr6" href="javascript:;"><i class="fa fas fa-fw fa-image" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('图片', 'jio') . '</span></a>';
$dropdown = '<div class="tab-content comment-image-tabs">';
$dropdown .= '<div class="tab-pane fade in active dropdown-image" id="image-tab-' . esc_attr($upload_id) . '-1">';
$dropdown .= '<p>' . esc_html__('请填写图片地址:', 'aksrt') . '</p>';
$dropdown .= '<p>' . esc_html__('请填写图片地址:', 'jio') . '</p>';
$dropdown .= '<p><textarea rows="2" tabindex="1" class="form-control input-textarea input-image-url" style="height:95px;" placeholder="http://..."></textarea></p>';
$dropdown .= '<div class="text-right">';
if ($upload) {
$dropdown .= '<a class="but c-yellow mr10 pw-1em input-image-upload-tab" data-image-tab="#image-tab-' . esc_attr($upload_id) . '-2" href="javascript:;">' . esc_html__('上传图片', 'aksrt') . '</a>';
$dropdown .= '<a class="but c-yellow mr10 pw-1em input-image-upload-tab" data-image-tab="#image-tab-' . esc_attr($upload_id) . '-2" href="javascript:;">' . esc_html__('上传图片', 'jio') . '</a>';
}
$dropdown .= '<a type="submit" class="but c-blue pw-1em input-image-submit" href="javascript:;">' . esc_html__('确认', 'aksrt') . '</a>';
$dropdown .= '<a type="submit" class="but c-blue pw-1em input-image-submit" href="javascript:;">' . esc_html__('确认', 'jio') . '</a>';
$dropdown .= '</div></div>';
if ($upload) {
$placeholder = get_template_directory_uri() . '/assets/icons/upload-add.svg';
$dropdown .= '<div class="tab-pane fade dropdown-image" id="image-tab-' . esc_attr($upload_id) . '-2">';
$dropdown .= '<p><a class="muted-color input-image-address-tab" data-image-tab="#image-tab-' . esc_attr($upload_id) . '-1" href="javascript:;"><i class="fa fas fa-angle-left mr6" aria-hidden="true"></i>' . esc_html__('填写图片地址', 'aksrt') . '</a></p>';
$dropdown .= '<p><a class="muted-color input-image-address-tab" data-image-tab="#image-tab-' . esc_attr($upload_id) . '-1" href="javascript:;"><i class="fa fas fa-angle-left mr6" aria-hidden="true"></i>' . esc_html__('填写图片地址', 'jio') . '</a></p>';
$dropdown .= '<div class="form-upload comment-image-upload">';
$dropdown .= '<label class="pointer comment-image-upload-label">';
$dropdown .= '<div class="preview text-center mb6"><img src="' . esc_url($placeholder) . '" alt="" /></div>';
$dropdown .= '<input class="hide comment-image-file" type="file" id="input_' . esc_attr($upload_id) . '_image_upload" accept="image/gif,image/jpeg,image/jpg,image/png" name="image">';
$dropdown .= '</label>';
$dropdown .= '<div class="text-right"><button type="button" class="but jb-blue pw-1em input-expand-upload" data-comment-upload-submit="1">' . esc_html__('确认上传', 'aksrt') . '</button></div>';
$dropdown .= '<div class="text-right"><button type="button" class="but jb-blue pw-1em input-expand-upload" data-comment-upload-submit="1">' . esc_html__('确认上传', 'jio') . '</button></div>';
$dropdown .= '</div></div>';
}
$dropdown .= '</div>';
@@ -108,25 +108,25 @@ if (!function_exists('aksrt_get_input_expand_but')) :
}
endif;
if (!function_exists('aksrt_render_comment_expand_toolbar')) :
if (!function_exists('jio_render_comment_expand_toolbar')) :
/**
* Render left-side expand tools based on settings (legacy order: code/image/link).
*
* @param array<string,mixed> $ctx Comments context.
*/
function aksrt_render_comment_expand_toolbar(array $ctx): void {
function jio_render_comment_expand_toolbar(array $ctx): void {
$toolbar = is_array($ctx['toolbar'] ?? null) ? $ctx['toolbar'] : [];
$upload = !empty($ctx['upload_enabled']);
$link_s = !empty($ctx['link_enabled']);
if (!empty($toolbar['code'])) {
echo aksrt_get_input_expand_but('code'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo jio_get_input_expand_but('code'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
if (!empty($toolbar['image'])) {
echo aksrt_get_input_expand_but('image', $upload, ['upload' => $upload]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo jio_get_input_expand_but('image', $upload, ['upload' => $upload]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
if ($link_s) {
echo aksrt_get_input_expand_but('link'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo jio_get_input_expand_but('link'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
endif;
+36 -36
View File
@@ -2,34 +2,34 @@
/**
* Comment city / IP geo helpers.
*
* Meta: aksrt_comment_addr {country,province,city}
* Meta: jio_comment_addr {country,province,city}
* Gates: ip_geo_enabled + ip_geo_display has comment(扩展&增强 / IP归属地统一控制)
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_comment_city_enabled')) :
function aksrt_comment_city_enabled(): bool {
if (!function_exists('jio_comment_city_enabled')) :
function jio_comment_city_enabled(): bool {
// 评论区位置显示的开关与精度统一由「扩展&增强 / IP归属地」配置提供。
return function_exists('aksrt_ip_geo_display_enabled') && aksrt_ip_geo_display_enabled('comment');
return function_exists('jio_ip_geo_display_enabled') && jio_ip_geo_display_enabled('comment');
}
endif;
if (!function_exists('aksrt_comment_city_type')) :
function aksrt_comment_city_type(): string {
return function_exists('aksrt_ip_geo_format_key') ? aksrt_ip_geo_format_key() : 'province_city';
if (!function_exists('jio_comment_city_type')) :
function jio_comment_city_type(): string {
return function_exists('jio_ip_geo_format_key') ? jio_ip_geo_format_key() : 'province_city';
}
endif;
if (!function_exists('aksrt_store_comment_addr')) :
if (!function_exists('jio_store_comment_addr')) :
/**
* @param int $comment_id Comment ID.
* @param string|null $ip Optional IP override.
*/
function aksrt_store_comment_addr(int $comment_id, ?string $ip = null): void {
if ($comment_id <= 0 || !aksrt_comment_city_enabled()) {
function jio_store_comment_addr(int $comment_id, ?string $ip = null): void {
if ($comment_id <= 0 || !jio_comment_city_enabled()) {
return;
}
if ($ip === null || $ip === '') {
@@ -43,8 +43,8 @@ if (!function_exists('aksrt_store_comment_addr')) :
if (!$needs_live && function_exists('filter_var')) {
$needs_live = !filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE);
}
if ($needs_live && function_exists('aksrt_get_client_ip')) {
$live = trim((string) aksrt_get_client_ip());
if ($needs_live && function_exists('jio_get_client_ip')) {
$live = trim((string) jio_get_client_ip());
if ($live !== '' && $live !== '0.0.0.0'
&& filter_var($live, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)
) {
@@ -55,10 +55,10 @@ if (!function_exists('aksrt_store_comment_addr')) :
if ($ip === '') {
return;
}
if (function_exists('aksrt_lookup_geo_for_ip')) {
$addr = aksrt_lookup_geo_for_ip($ip);
} elseif (class_exists('\AKSRT\Extensions\IPGeo')) {
$geo = \AKSRT\Extensions\IPGeo::get_instance()->lookup($ip);
if (function_exists('jio_lookup_geo_for_ip')) {
$addr = jio_lookup_geo_for_ip($ip);
} elseif (class_exists('\Jio\Extensions\IPGeo')) {
$geo = \Jio\Extensions\IPGeo::get_instance()->lookup($ip);
$addr = [
'country' => (string) ($geo['country'] ?? ''),
'province' => (string) ($geo['province'] ?? ''),
@@ -70,60 +70,60 @@ if (!function_exists('aksrt_store_comment_addr')) :
if ($addr['country'] === '' && $addr['province'] === '' && $addr['city'] === '') {
return;
}
update_comment_meta($comment_id, 'aksrt_comment_addr', $addr);
update_comment_meta($comment_id, 'jio_comment_addr', $addr);
}
endif;
if (!function_exists('aksrt_get_comment_addr')) :
if (!function_exists('jio_get_comment_addr')) :
/**
* @param int|WP_Comment $comment Comment.
* @return array{country:string,province:string,city:string}
*/
function aksrt_get_comment_addr($comment): array {
function jio_get_comment_addr($comment): array {
$comment_id = $comment instanceof WP_Comment ? (int) $comment->comment_ID : (int) $comment;
if ($comment_id <= 0) {
return ['country' => '', 'province' => '', 'city' => ''];
}
$raw = get_comment_meta($comment_id, 'aksrt_comment_addr', true);
if (function_exists('aksrt_normalize_geo_addr')) {
return aksrt_normalize_geo_addr($raw);
$raw = get_comment_meta($comment_id, 'jio_comment_addr', true);
if (function_exists('jio_normalize_geo_addr')) {
return jio_normalize_geo_addr($raw);
}
return is_array($raw) ? $raw : ['country' => '', 'province' => '', 'city' => ''];
}
endif;
if (!function_exists('aksrt_format_comment_city_label')) :
if (!function_exists('jio_format_comment_city_label')) :
/**
* @param array<string,string> $addr Addr.
* @param string $type Format.
*/
function aksrt_format_comment_city_label(array $addr, string $type = 'province_city'): string {
if (function_exists('aksrt_format_geo_label')) {
return aksrt_format_geo_label($addr, $type);
function jio_format_comment_city_label(array $addr, string $type = 'province_city'): string {
if (function_exists('jio_format_geo_label')) {
return jio_format_geo_label($addr, $type);
}
return '';
}
endif;
if (!function_exists('aksrt_get_comment_city_badge_html')) :
function aksrt_get_comment_city_badge_html($comment): string {
if (!aksrt_comment_city_enabled()) {
if (!function_exists('jio_get_comment_city_badge_html')) :
function jio_get_comment_city_badge_html($comment): string {
if (!jio_comment_city_enabled()) {
return '';
}
// legacy 契约:无属地数据时不渲染徽章(不使用查询失败兜底文案)。
$addr = aksrt_get_comment_addr($comment);
$label = function_exists('aksrt_format_geo_label')
? aksrt_format_geo_label(is_array($addr) ? $addr : [], aksrt_comment_city_type())
$addr = jio_get_comment_addr($comment);
$label = function_exists('jio_format_geo_label')
? jio_format_geo_label(is_array($addr) ? $addr : [], jio_comment_city_type())
: '';
if ($label === '') {
return '';
}
return '<span class="badg badg-sm comment-city-badge aksrt-ip-geo-badge" title="' . esc_attr__('IP 属地', 'aksrt') . '">' . esc_html($label) . '</span>';
return '<span class="badg badg-sm comment-city-badge jio-ip-geo-badge" title="' . esc_attr__('IP 属地', 'jio') . '">' . esc_html($label) . '</span>';
}
endif;
add_action('comment_post', static function ($comment_id): void {
if (function_exists('aksrt_store_comment_addr')) {
aksrt_store_comment_addr((int) $comment_id);
if (function_exists('jio_store_comment_addr')) {
jio_store_comment_addr((int) $comment_id);
}
}, 20, 1);
+4 -4
View File
@@ -6,12 +6,12 @@
* definitions are injected by assets/js/runtime/svg-icon.js, which the
* vendor runtime lazy-loads on every page (main.js: tbquire(['svg-icon'])).
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_get_comment_icon')) :
if (!function_exists('jio_get_comment_icon')) :
/**
* Sprite-referenced SVG icon (legacy: zib_get_svg).
*
@@ -19,7 +19,7 @@ if (!function_exists('aksrt_get_comment_icon')) :
* @param string $class Classes for the svg element.
* @return string
*/
function aksrt_get_comment_icon(string $name, string $class = 'icon'): string {
return aksrt_icon_markup('zibsvg-' . $name, $class);
function jio_get_comment_icon(string $name, string $class = 'icon'): string {
return jio_icon_markup('zibsvg-' . $name, $class);
}
endif;
+70 -70
View File
@@ -5,12 +5,12 @@
* Mirrors legacy / legacy / legacy
* from the legacy comments-list module.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_get_comment_like_html')) :
if (!function_exists('jio_get_comment_like_html')) :
/**
* Header like control (legacy: legacy).
*
@@ -18,7 +18,7 @@ if (!function_exists('aksrt_get_comment_like_html')) :
* @param bool $enabled Like enabled.
* @return string
*/
function aksrt_get_comment_like_html($comment, bool $enabled = true): string {
function jio_get_comment_like_html($comment, bool $enabled = true): string {
if (!$enabled) {
return '';
}
@@ -26,11 +26,11 @@ if (!function_exists('aksrt_get_comment_like_html')) :
if ($comment_id <= 0) {
return '';
}
$like_count = function_exists('aksrt_get_comment_likes') ? (int) aksrt_get_comment_likes($comment_id) : 0;
$like_label = function_exists('aksrt_format_number') ? aksrt_format_number($like_count) : number_format_i18n($like_count);
$is_liked = function_exists('aksrt_is_comment_liked') && aksrt_is_comment_liked($comment_id);
$like_count = function_exists('jio_get_comment_likes') ? (int) jio_get_comment_likes($comment_id) : 0;
$like_label = function_exists('jio_format_number') ? jio_format_number($like_count) : number_format_i18n($like_count);
$is_liked = function_exists('jio_is_comment_liked') && jio_is_comment_liked($comment_id);
$classes = 'action action-comment-like muted-2-color flex0 ml10' . ($is_liked ? ' actived' : '');
$icon = function_exists('aksrt_get_comment_icon') ? aksrt_get_comment_icon('like', 'icon mr3') : '';
$icon = function_exists('jio_get_comment_icon') ? jio_get_comment_icon('like', 'icon mr3') : '';
return sprintf(
'<a href="javascript:;" data-comment-action="like" data-action="comment_like" class="%1$s" data-pid="%2$d" data-active="%3$s" aria-pressed="%4$s">%5$s<text></text><count>%6$s</count></a>',
@@ -44,7 +44,7 @@ if (!function_exists('aksrt_get_comment_like_html')) :
}
endif;
if (!function_exists('aksrt_get_comment_avatar_box')) :
if (!function_exists('jio_get_comment_avatar_box')) :
/**
* Comment avatar box (legacy: legacy).
*
@@ -53,7 +53,7 @@ if (!function_exists('aksrt_get_comment_avatar_box')) :
* @param bool $link Wrap in a link when a target URL exists.
* @return string
*/
function aksrt_get_comment_avatar_box(WP_Comment $comment, string $class = 'avatar-img comt-avatar', bool $link = true): string {
function jio_get_comment_avatar_box(WP_Comment $comment, string $class = 'avatar-img comt-avatar', bool $link = true): string {
$user_id = (int) $comment->user_id;
$size = 45;
$avatar = $user_id > 0
@@ -65,7 +65,7 @@ if (!function_exists('aksrt_get_comment_avatar_box')) :
return $html;
}
if ($user_id > 0) {
$url = function_exists('aksrt_get_user_home_url') ? aksrt_get_user_home_url($user_id) : get_author_posts_url($user_id);
$url = function_exists('jio_get_user_home_url') ? jio_get_user_home_url($user_id) : get_author_posts_url($user_id);
return '<a href="' . esc_url($url) . '">' . $html . '</a>';
}
if (!empty($comment->comment_author_url)) {
@@ -75,7 +75,7 @@ if (!function_exists('aksrt_get_comment_avatar_box')) :
}
endif;
if (!function_exists('aksrt_get_comments_user_name_html')) :
if (!function_exists('jio_get_comments_user_name_html')) :
/**
* Name row (legacy: legacy) — topping + author + badges.
*
@@ -83,26 +83,26 @@ if (!function_exists('aksrt_get_comments_user_name_html')) :
* @param array<string,mixed> $settings Display settings.
* @return string
*/
function aksrt_get_comments_user_name_html(WP_Comment $comment, array $settings = []): string {
function jio_get_comments_user_name_html(WP_Comment $comment, array $settings = []): string {
$user_id = (int) $comment->user_id;
$show_author_tag = !isset($settings['author_tag']) || !empty($settings['author_tag']);
$is_pinned = function_exists('aksrt_is_comment_pinned') && aksrt_is_comment_pinned($comment);
$is_pinned = function_exists('jio_is_comment_pinned') && jio_is_comment_pinned($comment);
$is_post_author = $user_id > 0 && $user_id === (int) get_post_field('post_author', $comment->comment_post_ID);
$topping = '';
if ($is_pinned) {
$topping_icon = function_exists('aksrt_get_comment_icon') ? aksrt_get_comment_icon('topping') : '';
$topping = '<badge class="badge-topping jb-blue mr6 flex0" title="' . esc_attr__('置顶评论', 'aksrt') . '" data-toggle="tooltip">' . $topping_icon . '</badge>';
$topping_icon = function_exists('jio_get_comment_icon') ? jio_get_comment_icon('topping') : '';
$topping = '<badge class="badge-topping jb-blue mr6 flex0" title="' . esc_attr__('置顶评论', 'jio') . '" data-toggle="tooltip">' . $topping_icon . '</badge>';
}
$user_name = '';
if ($user_id > 0) {
$user = get_userdata($user_id);
if ($user instanceof WP_User) {
$url = function_exists('aksrt_get_user_home_url') ? aksrt_get_user_home_url($user_id) : get_author_posts_url($user_id);
$url = function_exists('jio_get_user_home_url') ? jio_get_user_home_url($user_id) : get_author_posts_url($user_id);
$user_name = '<a class="text-ellipsis font-bold" href="' . esc_url($url) . '">' . esc_html($user->display_name) . '</a>';
if (function_exists('aksrt_render_user_identity_chips')) {
$user_name .= aksrt_render_user_identity_chips($user_id, 'comment');
if (function_exists('jio_render_user_identity_chips')) {
$user_name .= jio_render_user_identity_chips($user_id, 'comment');
}
}
} elseif (!empty($comment->comment_author_url)) {
@@ -113,14 +113,14 @@ if (!function_exists('aksrt_get_comments_user_name_html')) :
$badge = '';
if ($show_author_tag && $is_post_author) {
$badge .= '<span class="badg c-green badg-sm flex0 ml3">' . esc_html__('作者', 'aksrt') . '</span>';
$badge .= '<span class="badg c-green badg-sm flex0 ml3">' . esc_html__('作者', 'jio') . '</span>';
}
return '<name class="flex ac flex1">' . $topping . $user_name . $badge . '</name>';
}
endif;
if (!function_exists('aksrt_get_comment_header_html')) :
if (!function_exists('jio_get_comment_header_html')) :
/**
* Comment header (legacy: legacy).
*
@@ -128,11 +128,11 @@ if (!function_exists('aksrt_get_comment_header_html')) :
* @param array<string,mixed> $settings Settings.
* @return string
*/
function aksrt_get_comment_header_html(WP_Comment $comment, array $settings = []): string {
function jio_get_comment_header_html(WP_Comment $comment, array $settings = []): string {
$like_enabled = !isset($settings['like_enabled']) || !empty($settings['like_enabled']);
$avatar = aksrt_get_comment_avatar_box($comment, 'avatar-img comt-avatar');
$name = aksrt_get_comments_user_name_html($comment, $settings);
$like = aksrt_get_comment_like_html($comment, $like_enabled);
$avatar = jio_get_comment_avatar_box($comment, 'avatar-img comt-avatar');
$name = jio_get_comments_user_name_html($comment, $settings);
$like = jio_get_comment_like_html($comment, $like_enabled);
$html = '<div class="author-box flex ac">';
$html .= $avatar;
@@ -144,17 +144,17 @@ if (!function_exists('aksrt_get_comment_header_html')) :
}
endif;
if (!function_exists('aksrt_get_comment_report_html')) :
if (!function_exists('jio_get_comment_report_html')) :
/**
* 评论举报入口 — 登录用户可举报他人评论(前台走 report.js 的 data-aksrt-report 契约)。
* 评论举报入口 — 登录用户可举报他人评论(前台走 report.js 的 data-jio-report 契约)。
*
* 举报位于“回复”右侧三点下拉菜单内(参考主题同位置)。
*
* @param WP_Comment $comment Comment.
* @return string
*/
function aksrt_get_comment_report_html(WP_Comment $comment): string {
if (!is_user_logged_in() || !class_exists('\AKSRT\Settings\Settings')) {
function jio_get_comment_report_html(WP_Comment $comment): string {
if (!is_user_logged_in() || !class_exists('\Jio\Settings\Settings')) {
return '';
}
@@ -164,15 +164,15 @@ if (!function_exists('aksrt_get_comment_report_html')) :
return '';
}
// 已封禁/小黑屋用户不再显示举报入口(参考主题 zib_get_report_link 排除语义)。
if ($author_id > 0 && function_exists('aksrt_is_user_ban_restricted') && aksrt_is_user_ban_restricted($author_id)) {
if ($author_id > 0 && function_exists('jio_is_user_ban_restricted') && jio_is_user_ban_restricted($author_id)) {
return '';
}
$settings = \AKSRT\Settings\Settings::get_user_identity_settings();
$settings = \Jio\Settings\Settings::get_user_identity_settings();
if (empty($settings['report']['enabled'])) {
return '';
}
if (function_exists('aksrt_user_can') && !aksrt_user_can('user_report', $reporter_id, $author_id)) {
if (function_exists('jio_user_can') && !jio_user_can('user_report', $reporter_id, $author_id)) {
return '';
}
@@ -182,11 +182,11 @@ if (!function_exists('aksrt_get_comment_report_html')) :
'target_name' => get_comment_author($comment),
]);
return '<li><a class="comment-report-link" href="javascript:;" data-aksrt-report="' . esc_attr((string) $report_payload) . '"><i class="fa fas fa-exclamation-triangle mr10 fa-fw c-red" aria-hidden="true"></i>' . esc_html__('举报', 'aksrt') . '</a></li>';
return '<li><a class="comment-report-link" href="javascript:;" data-jio-report="' . esc_attr((string) $report_payload) . '"><i class="fa fas fa-exclamation-triangle mr10 fa-fw c-red" aria-hidden="true"></i>' . esc_html__('举报', 'jio') . '</a></li>';
}
endif;
if (!function_exists('aksrt_get_comments_action_dropdown_html')) :
if (!function_exists('jio_get_comments_action_dropdown_html')) :
/**
* More-actions menu (legacy: legacy) — pin / edit / approve / delete.
*
@@ -194,52 +194,52 @@ if (!function_exists('aksrt_get_comments_action_dropdown_html')) :
* @param int $depth Depth.
* @return string
*/
function aksrt_get_comments_action_dropdown_html(WP_Comment $comment, int $depth = 0): string {
$perms = function_exists('aksrt_comment_action_permissions')
? aksrt_comment_action_permissions($comment)
function jio_get_comments_action_dropdown_html(WP_Comment $comment, int $depth = 0): string {
$perms = function_exists('jio_comment_action_permissions')
? jio_comment_action_permissions($comment)
: ['can_edit' => false, 'can_delete' => false, 'can_moderate' => false, 'can_pin' => false];
$is_pinned = function_exists('aksrt_is_comment_pinned') && aksrt_is_comment_pinned($comment);
$is_pinned = function_exists('jio_is_comment_pinned') && jio_is_comment_pinned($comment);
$is_pending = '0' === (string) $comment->comment_approved;
$lists = '';
if (!empty($perms['can_pin']) && (int) $comment->comment_parent === 0) {
$label = $is_pinned ? __('取消置顶', 'aksrt') : __('设置置顶', 'aksrt');
$label = $is_pinned ? __('取消置顶', 'jio') : __('设置置顶', 'jio');
// 不带 legacy 的 wp-ajax-submit 类:vendor main.min.js 会全局代理该类并向
// admin-ajax 发空 action 请求(400 "0"),置顶走 data-comment-action REST。
$lists .= '<li><a class="comment-topping" data-comment-action="pin" data-pinned="' . ($is_pinned ? '1' : '0') . '" href="javascript:;"><i class="fa fas fa-thumbtack mr10 fa-fw" aria-hidden="true"></i>' . esc_html($label) . '</a></li>';
}
if (!empty($perms['can_edit'])) {
$lists .= '<li><a class="comment-edit-link" data-commentid="' . (int) $comment->comment_ID . '" data-postid="' . (int) $comment->comment_post_ID . '" href="javascript:;"><i class="fa fas fa-edit mr10 fa-fw" aria-hidden="true"></i>' . esc_html__('编辑', 'aksrt') . '</a></li>';
$lists .= '<li><a class="comment-edit-link" data-commentid="' . (int) $comment->comment_ID . '" data-postid="' . (int) $comment->comment_post_ID . '" href="javascript:;"><i class="fa fas fa-edit mr10 fa-fw" aria-hidden="true"></i>' . esc_html__('编辑', 'jio') . '</a></li>';
}
if (!empty($perms['can_moderate'])) {
$text = $is_pending ? __('批准', 'aksrt') : __('驳回', 'aksrt');
$text = $is_pending ? __('批准', 'jio') : __('驳回', 'jio');
$class = $is_pending ? 'approve' : 'unapprove';
$action = $is_pending ? 'approve' : 'hold';
$approve_icon = function_exists('aksrt_get_comment_icon') ? aksrt_get_comment_icon('approve', 'mr10 icon fa-fw') : '';
$approve_icon = function_exists('jio_get_comment_icon') ? jio_get_comment_icon('approve', 'mr10 icon fa-fw') : '';
$lists .= '<li><a class="comment-approve-link ' . $class . '" data-comment-action="' . $action . '" data-commentid="' . (int) $comment->comment_ID . '" data-postid="' . (int) $comment->comment_post_ID . '" href="javascript:;">' . $approve_icon . '<text>' . esc_html($text) . '</text></a></li>';
}
if (!empty($perms['can_delete'])) {
$lists .= '<li><a class="comment-trash-link c-red" data-comment-action="delete" data-commentid="' . (int) $comment->comment_ID . '" data-postid="' . (int) $comment->comment_post_ID . '" href="javascript:;"><i class="fa far fa-trash-alt mr10 fa-fw" aria-hidden="true"></i>' . esc_html__('删除', 'aksrt') . '</a></li>';
$lists .= '<li><a class="comment-trash-link c-red" data-comment-action="delete" data-commentid="' . (int) $comment->comment_ID . '" data-postid="' . (int) $comment->comment_post_ID . '" href="javascript:;"><i class="fa far fa-trash-alt mr10 fa-fw" aria-hidden="true"></i>' . esc_html__('删除', 'jio') . '</a></li>';
}
// 末项(参考主题 comments_action_lists 钩子顺序):管理员 → 禁封用户;
// 否则 → 举报(登录且非本人且举报开启时,既有评论举报契约)。
$lists .= aksrt_get_comment_ban_or_report_item($comment);
$lists .= jio_get_comment_ban_or_report_item($comment);
if ($lists === '') {
return '';
}
$menu_icon = function_exists('aksrt_get_comment_icon') ? aksrt_get_comment_icon('menu_2') : '';
// 交互由主题自有 comments.js 委托处理(data-aksrt-comment-drop),
$menu_icon = function_exists('jio_get_comment_icon') ? jio_get_comment_icon('menu_2') : '';
// 交互由主题自有 comments.js 委托处理(data-jio-comment-drop),
// 不用 vendor 的 data-toggle="dropdown" 遗留委托:该链路在部分环境
// 未注册/被早退,导致三点菜单点不开。open 类驱动的 CSS 契约不变。
$icon_a = '<a href="javascript:;" class="muted-color padding-6" data-aksrt-comment-drop aria-haspopup="true" aria-expanded="false" aria-label="' . esc_attr__('更多操作', 'aksrt') . '">' . $menu_icon . '</a>';
$icon_a = '<a href="javascript:;" class="muted-color padding-6" data-jio-comment-drop aria-haspopup="true" aria-expanded="false" aria-label="' . esc_attr__('更多操作', 'jio') . '">' . $menu_icon . '</a>';
return '<span class="dropdown drop-fixed-sm padding-6">' . $icon_a . '<ul class="dropdown-menu">' . $lists . '</ul></span>';
}
endif;
if (!function_exists('aksrt_get_comment_footer_html')) :
if (!function_exists('jio_get_comment_footer_html')) :
/**
* comt-meta row (legacy: legacy).
*
@@ -249,25 +249,25 @@ if (!function_exists('aksrt_get_comment_footer_html')) :
* @param array<string,mixed> $settings Settings.
* @return string
*/
function aksrt_get_comment_footer_html(WP_Comment $comment, array $args, int $depth, array $settings = []): string {
function jio_get_comment_footer_html(WP_Comment $comment, array $args, int $depth, array $settings = []): string {
$is_pending = '0' === (string) $comment->comment_approved;
$is_mobile = wp_is_mobile();
$badg_approve = '';
if ($is_pending) {
$badg_approve = '<span class="badg c-red badg-sm">' . esc_html__('待审核', 'aksrt') . '</span>';
$badg_approve = '<span class="badg c-red badg-sm">' . esc_html__('待审核', 'jio') . '</span>';
}
$badg_approve = '<span class="badge-approve">' . $badg_approve . '</span>';
$absolute = date_i18n(__('Y年m月d日 H:i:s', 'aksrt'), strtotime((string) $comment->comment_date));
$ago = function_exists('aksrt_time_ago')
? aksrt_time_ago((string) $comment->comment_date)
: human_time_diff(strtotime((string) $comment->comment_date), current_time('timestamp')) . __('前', 'aksrt');
$absolute = date_i18n(__('Y年m月d日 H:i:s', 'jio'), strtotime((string) $comment->comment_date));
$ago = function_exists('jio_time_ago')
? jio_time_ago((string) $comment->comment_date)
: human_time_diff(strtotime((string) $comment->comment_date), current_time('timestamp')) . __('前', 'jio');
$time_html = '<span class="comt-author"' . ($is_mobile ? ' data-toggle="tooltip"' : '') . ' title="' . esc_attr($absolute) . '">' . esc_html($ago) . '</span>';
$city_html = function_exists('aksrt_get_comment_city_badge_html')
? aksrt_get_comment_city_badge_html($comment)
$city_html = function_exists('jio_get_comment_city_badge_html')
? jio_get_comment_city_badge_html($comment)
: '';
$parent_html = '';
@@ -282,8 +282,8 @@ if (!function_exists('aksrt_get_comment_footer_html')) :
$link = get_comment_reply_link(
[
'add_below' => 'div-comment',
'reply_text' => __('回复', 'aksrt'),
'login_text' => __('回复', 'aksrt'),
'reply_text' => __('回复', 'jio'),
'login_text' => __('回复', 'jio'),
'depth' => $depth,
'max_depth' => $max_depth,
],
@@ -305,14 +305,14 @@ if (!function_exists('aksrt_get_comment_footer_html')) :
}
}
$actions = aksrt_get_comments_action_dropdown_html($comment, $depth);
$actions = jio_get_comments_action_dropdown_html($comment, $depth);
$info = $time_html . $city_html . $parent_html . $badg_approve . $reply_html;
return '<div class="comt-meta muted-2-color">' . $info . $actions . '</div>';
}
endif;
if (!function_exists('aksrt_get_comments_list_html')) :
if (!function_exists('jio_get_comments_list_html')) :
/**
* Single comment item HTML (legacy: legacy).
*
@@ -322,13 +322,13 @@ if (!function_exists('aksrt_get_comments_list_html')) :
* @param array $settings Settings.
* @return string
*/
function aksrt_get_comments_list_html(WP_Comment $comment, array $args = [], int $depth = 0, array $settings = []): string {
function jio_get_comments_list_html(WP_Comment $comment, array $args = [], int $depth = 0, array $settings = []): string {
$comment_id = (int) $comment->comment_ID;
$con = function_exists('aksrt_render_comment_content')
? aksrt_render_comment_content((string) get_comment_text($comment))
$con = function_exists('jio_render_comment_content')
? jio_render_comment_content((string) get_comment_text($comment))
: wp_kses_post((string) get_comment_text($comment));
$header = aksrt_get_comment_header_html($comment, $settings);
$footer = aksrt_get_comment_footer_html($comment, $args, $depth, $settings);
$header = jio_get_comment_header_html($comment, $settings);
$footer = jio_get_comment_footer_html($comment, $args, $depth, $settings);
$html = '<li ' . comment_class('', $comment, null, false) . ' id="comment-' . esc_attr((string) $comment_id) . '">';
$html .= '<ul class="list-inline">';
@@ -344,7 +344,7 @@ if (!function_exists('aksrt_get_comments_list_html')) :
}
endif;
if (!function_exists('aksrt_comment_callback')) :
if (!function_exists('jio_comment_callback')) :
/**
* Canonical wp_list_comments callback (legacy: legacy).
*
@@ -354,15 +354,15 @@ if (!function_exists('aksrt_comment_callback')) :
* @param array $args Args.
* @param int $depth Depth.
*/
function aksrt_comment_callback($comment, $args, $depth) {
function jio_comment_callback($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
$settings = get_query_var('aksrt_comment_settings', []);
$settings = get_query_var('jio_comment_settings', []);
$settings = is_array($settings) ? $settings : [];
if (empty($settings) && class_exists('\AKSRT\Settings\Settings')) {
$settings = \AKSRT\Settings\Settings::get_comment_display_settings();
if (empty($settings) && class_exists('\Jio\Settings\Settings')) {
$settings = \Jio\Settings\Settings::get_comment_display_settings();
}
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- composed helpers escape.
echo aksrt_get_comments_list_html($comment, is_array($args) ? $args : [], (int) $depth, $settings);
echo jio_get_comments_list_html($comment, is_array($args) ? $args : [], (int) $depth, $settings);
}
endif;