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:
1 parent
5b16bc6e15
commit
35bb96e82f
997 files changed
+28216
-28188
No files matched your search
@@ -2,13 +2,13 @@
|
||||
/**
|
||||
* legacy 9.0 article-list DOM contract.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!function_exists('aksrt_renderer_list')) {
|
||||
function aksrt_renderer_list(array $data, array $cfg): string {
|
||||
if (!function_exists('jio_renderer_list')) {
|
||||
function jio_renderer_list(array $data, array $cfg): string {
|
||||
$classes = ['posts-item', 'list', 'ajax-item'];
|
||||
if ((string) ($cfg['style'] ?? '') !== '') {
|
||||
$classes[] = (string) $cfg['style'];
|
||||
@@ -24,17 +24,17 @@ if (!function_exists('aksrt_renderer_list')) {
|
||||
}
|
||||
$classes[] = ($cfg['style'] ?? '') === 'style2' ? 'flex xx' : 'flex';
|
||||
|
||||
$title = '<h2 class="item-heading' . (!empty($cfg['heading_bold']) ? ' font-bold' : '') . '"><a' . (!empty($cfg['target_blank']) ? ' target="_blank"' : '') . ' href="' . esc_url((string) $data['permalink']) . '">' . aksrt_renderer_title_markup($data, $cfg) . '</a></h2>';
|
||||
$title = '<h2 class="item-heading' . (!empty($cfg['heading_bold']) ? ' font-bold' : '') . '"><a' . (!empty($cfg['target_blank']) ? ' target="_blank"' : '') . ' href="' . esc_url((string) $data['permalink']) . '">' . jio_renderer_title_markup($data, $cfg) . '</a></h2>';
|
||||
$excerpt_class = ($cfg['style'] ?? '') === 'style2' ? 'text-ellipsis-2' : 'text-ellipsis';
|
||||
$excerpt = '<div class="item-excerpt muted-color ' . $excerpt_class . ' mb6">' . aksrt_renderer_excerpt_markup($data, $cfg) . '</div>';
|
||||
$thumb = aksrt_renderer_thumb($data, $cfg);
|
||||
$mult = aksrt_renderer_mult_thumb($data, $cfg);
|
||||
$excerpt = '<div class="item-excerpt muted-color ' . $excerpt_class . ' mb6">' . jio_renderer_excerpt_markup($data, $cfg) . '</div>';
|
||||
$thumb = jio_renderer_thumb($data, $cfg);
|
||||
$mult = jio_renderer_mult_thumb($data, $cfg);
|
||||
$graphic = '';
|
||||
if ($thumb !== '' && empty($data['is_mult_thumb'])) {
|
||||
$graphic = '<div class="post-graphic' . (($cfg['img_position'] ?? 'left') === 'right' ? ' order1' : '') . '">' . $thumb . '</div>';
|
||||
}
|
||||
$badges = aksrt_renderer_badges($data, $cfg);
|
||||
$meta = aksrt_renderer_meta($data, $cfg, false);
|
||||
$badges = jio_renderer_badges($data, $cfg);
|
||||
$meta = jio_renderer_meta($data, $cfg, false);
|
||||
$html = '<posts class="' . esc_attr(implode(' ', $classes)) . '">';
|
||||
if (($cfg['style'] ?? '') === 'style2') {
|
||||
$html .= $title . '<div class="flex">' . $graphic . '<div class="item-body flex xx flex1 jsb">';
|
||||
@@ -49,32 +49,32 @@ if (!function_exists('aksrt_renderer_list')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_renderer_card')) {
|
||||
function aksrt_renderer_card(array $data, array $cfg): string {
|
||||
if (!function_exists('jio_renderer_card')) {
|
||||
function jio_renderer_card(array $data, array $cfg): string {
|
||||
$classes = ['posts-item', 'card', 'ajax-item'];
|
||||
if ((string) ($cfg['style'] ?? '') !== '') {
|
||||
$classes[] = (string) $cfg['style'];
|
||||
}
|
||||
$title = '<h2 class="item-heading' . (!empty($cfg['heading_bold']) ? ' font-bold' : '') . '"><a' . (!empty($cfg['target_blank']) ? ' target="_blank"' : '') . ' href="' . esc_url((string) $data['permalink']) . '">' . aksrt_renderer_title_markup($data, $cfg) . '</a></h2>';
|
||||
$title = '<h2 class="item-heading' . (!empty($cfg['heading_bold']) ? ' font-bold' : '') . '"><a' . (!empty($cfg['target_blank']) ? ' target="_blank"' : '') . ' href="' . esc_url((string) $data['permalink']) . '">' . jio_renderer_title_markup($data, $cfg) . '</a></h2>';
|
||||
|
||||
$html = '<posts class="' . esc_attr(implode(' ', $classes)) . '">';
|
||||
$html .= aksrt_renderer_thumb($data, $cfg);
|
||||
$html .= jio_renderer_thumb($data, $cfg);
|
||||
$html .= '<div class="item-body">' . $title;
|
||||
$html .= aksrt_renderer_badges($data, $cfg);
|
||||
$html .= aksrt_renderer_meta($data, $cfg, true);
|
||||
$html .= jio_renderer_badges($data, $cfg);
|
||||
$html .= jio_renderer_meta($data, $cfg, true);
|
||||
return $html . '</div></posts>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_renderer_mini')) {
|
||||
function aksrt_renderer_mini(array $data, array $cfg = []): string {
|
||||
if (!function_exists('jio_renderer_mini')) {
|
||||
function jio_renderer_mini(array $data, array $cfg = []): string {
|
||||
$target = !empty($cfg['target_blank']) ? ' target="_blank"' : '';
|
||||
$thumb = '';
|
||||
$show_thumb = !array_key_exists('show_thumb', $cfg) || !empty($cfg['show_thumb']);
|
||||
$show_meta = !array_key_exists('show_meta', $cfg) || !empty($cfg['show_meta']);
|
||||
if ($show_thumb && (string) $data['primary'] !== '') {
|
||||
$default_attr = empty($data['has_real']) ? ' data-thumb="default"' : '';
|
||||
$thumb = '<div class="mr10"><div class="item-thumbnail"><a' . $target . ' href="' . esc_url((string) $data['permalink']) . '"><img' . $default_attr . aksrt_get_lazy_attr('lazy_posts_thumb', (string) $data['primary'], 'fit-cover radius8') . ' alt="' . esc_attr((string) $data['title']) . '"></a></div></div>';
|
||||
$thumb = '<div class="mr10"><div class="item-thumbnail"><a' . $target . ' href="' . esc_url((string) $data['permalink']) . '"><img' . $default_attr . jio_get_lazy_attr('lazy_posts_thumb', (string) $data['primary'], 'fit-cover radius8') . ' alt="' . esc_attr((string) $data['title']) . '"></a></div></div>';
|
||||
}
|
||||
$number = '';
|
||||
if (!empty($cfg['show_number'])) {
|
||||
@@ -93,11 +93,11 @@ if (!function_exists('aksrt_renderer_mini')) {
|
||||
$show_time = !empty($cfg['show_time']);
|
||||
if (!empty($cfg['show_author'])) {
|
||||
$author_value = $show_time ? (string) $data['time_ago'] : (string) $data['author_name'];
|
||||
$meta_left = '<item class="meta-author flex ac">' . aksrt_get_avatar_box((int) $data['author_id'], 'avatar-mini') . '<span class="ml6">' . esc_html($author_value) . '</span></item>';
|
||||
$meta_left = '<item class="meta-author flex ac">' . jio_get_avatar_box((int) $data['author_id'], 'avatar-mini') . '<span class="ml6">' . esc_html($author_value) . '</span></item>';
|
||||
} else {
|
||||
$meta_left = $show_time ? '<item title="' . esc_attr((string) $data['time_title']) . '" class="icon-circle mln3">' . esc_html((string) $data['time_ago']) . '</item>' : '';
|
||||
}
|
||||
$pay = aksrt_renderer_pay_badge($data, true);
|
||||
$pay = jio_renderer_pay_badge($data, true);
|
||||
if ($meta_left === '') {
|
||||
$meta_left = $pay;
|
||||
$pay = '';
|
||||
@@ -105,7 +105,7 @@ if (!function_exists('aksrt_renderer_mini')) {
|
||||
if ($meta_left === '') {
|
||||
$meta_left = '<item></item>';
|
||||
}
|
||||
$meta_right = $pay . '<item class="meta-view">' . aksrt_renderer_svg_icon('view') . esc_html(aksrt_renderer_meta_number((int) $data['views'])) . '</item>';
|
||||
$meta_right = $pay . '<item class="meta-view">' . jio_renderer_svg_icon('view') . esc_html(jio_renderer_meta_number((int) $data['views'])) . '</item>';
|
||||
$meta = '<div class="item-meta muted-2-color flex jsb ac' . (!$show_thumb ? ' mt6' : '') . '">' . $meta_left . '<div class="meta-right">' . $meta_right . '</div></div>';
|
||||
}
|
||||
$class = trim('posts-mini ' . (string) ($cfg['class'] ?? ''));
|
||||
@@ -113,31 +113,31 @@ if (!function_exists('aksrt_renderer_mini')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_render_post')) {
|
||||
function aksrt_render_post(array $args = []): string {
|
||||
$cfg = aksrt_renderer_config($args);
|
||||
$data = aksrt_renderer_collect_post_data($cfg);
|
||||
if (!function_exists('jio_render_post')) {
|
||||
function jio_render_post(array $args = []): string {
|
||||
$cfg = jio_renderer_config($args);
|
||||
$data = jio_renderer_collect_post_data($cfg);
|
||||
if (!$data) {
|
||||
return '';
|
||||
}
|
||||
return ($cfg['mode'] ?? 'list') === 'card'
|
||||
? aksrt_renderer_card($data, $cfg)
|
||||
: aksrt_renderer_list($data, $cfg);
|
||||
? jio_renderer_card($data, $cfg)
|
||||
: jio_renderer_list($data, $cfg);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_render_post_list')) {
|
||||
if (!function_exists('jio_render_post_list')) {
|
||||
/**
|
||||
* Render the canonical article stream.
|
||||
*
|
||||
* @param array<string,mixed> $args legacy-shaped list arguments.
|
||||
* @param WP_Query|null $query Optional custom query.
|
||||
*/
|
||||
function aksrt_render_post_list(array $args = [], ?WP_Query $query = null, bool $echo = true): string {
|
||||
$cfg = aksrt_renderer_config($args);
|
||||
function jio_render_post_list(array $args = [], ?WP_Query $query = null, bool $echo = true): string {
|
||||
$cfg = jio_renderer_config($args);
|
||||
$has_posts = $query instanceof WP_Query ? $query->have_posts() : have_posts();
|
||||
if (!$has_posts) {
|
||||
$html = aksrt_get_null(__('暂无内容', 'aksrt'), 100, 'null-post.svg');
|
||||
$html = jio_get_null(__('暂无内容', 'jio'), 100, 'null-post.svg');
|
||||
if ($echo) {
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
return '';
|
||||
@@ -161,13 +161,13 @@ if (!function_exists('aksrt_render_post_list')) {
|
||||
if ($query instanceof WP_Query) {
|
||||
while ($query->have_posts()) {
|
||||
$query->the_post();
|
||||
$html .= aksrt_render_post($cfg);
|
||||
$html .= jio_render_post($cfg);
|
||||
}
|
||||
wp_reset_postdata();
|
||||
} else {
|
||||
while (have_posts()) {
|
||||
the_post();
|
||||
$html .= aksrt_render_post($cfg);
|
||||
$html .= jio_render_post($cfg);
|
||||
}
|
||||
}
|
||||
$html .= $append_inner_html;
|
||||
@@ -183,21 +183,21 @@ if (!function_exists('aksrt_render_post_list')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_render_mini_list')) {
|
||||
function aksrt_render_mini_list(WP_Query $query, array $args = [], bool $echo = true): string {
|
||||
$cfg = aksrt_renderer_config($args);
|
||||
if (!function_exists('jio_render_mini_list')) {
|
||||
function jio_render_mini_list(WP_Query $query, array $args = [], bool $echo = true): string {
|
||||
$cfg = jio_renderer_config($args);
|
||||
// The reference mini rows follow the site's list ordering time source.
|
||||
$cfg['time_source'] = $cfg['list_orderby'] === 'modified' ? 'modified' : 'date';
|
||||
$html = '';
|
||||
$number = max(0, (int) ($args['number_offset'] ?? 0));
|
||||
while ($query->have_posts()) {
|
||||
$query->the_post();
|
||||
$data = aksrt_renderer_collect_post_data($cfg);
|
||||
$data = jio_renderer_collect_post_data($cfg);
|
||||
if (!$data) {
|
||||
continue;
|
||||
}
|
||||
$number++;
|
||||
$html .= aksrt_renderer_mini($data, array_merge($cfg, ['number_offset' => $number]));
|
||||
$html .= jio_renderer_mini($data, array_merge($cfg, ['number_offset' => $number]));
|
||||
}
|
||||
wp_reset_postdata();
|
||||
if ($echo) {
|
||||
@@ -208,7 +208,7 @@ if (!function_exists('aksrt_render_mini_list')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_render_placeholder')) {
|
||||
if (!function_exists('jio_render_placeholder')) {
|
||||
/**
|
||||
* 骨架屏占位,1:1 对齐参考主题 `zib_get_post_placeholder()`。
|
||||
*
|
||||
@@ -226,7 +226,7 @@ if (!function_exists('aksrt_render_placeholder')) {
|
||||
* @param string $mode list|card|mini|mini_thumb。
|
||||
* @param int $count 重复数量,1–12。
|
||||
*/
|
||||
function aksrt_render_placeholder(string $mode = 'list', int $count = 3): string {
|
||||
function jio_render_placeholder(string $mode = 'list', int $count = 3): string {
|
||||
$count = max(1, min(12, $count));
|
||||
if ($mode === 'mini') {
|
||||
$item = '<div class="posts-mini"><div class="placeholder k1"></div></div>';
|
||||
|
||||
Reference in new issue
Block a user