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
@@ -76,16 +76,16 @@ function wp_kses($value, array $allowed): string {
|
||||
function is_wp_error($value): bool { return $value instanceof WP_Error; }
|
||||
function wp_is_mobile(): bool { return false; }
|
||||
function wp_reset_postdata(): void { $GLOBALS['discovery_current_post'] = null; }
|
||||
function aksrt_is_lazy(string $key, bool $default = false): bool { return false; }
|
||||
function aksrt_get_lazy_attr(string $type, string $url, string $class = '', string $lazy = ''): string { return ' class="' . esc_attr($class) . '" src="' . esc_url($url) . '"'; }
|
||||
function aksrt_format_number($number): string { return number_format((int) $number); }
|
||||
function aksrt_renderer_svg_icon(string $name): string { return '<svg class="zibsvg-' . esc_attr($name) . '" viewbox="0 0 16 16" aria-hidden="true"><use href="#zibsvg-' . esc_attr($name) . '"></use></svg>'; }
|
||||
function aksrt_renderer_collect_post_data(array $config = []): array {
|
||||
function jio_is_lazy(string $key, bool $default = false): bool { return false; }
|
||||
function jio_get_lazy_attr(string $type, string $url, string $class = '', string $lazy = ''): string { return ' class="' . esc_attr($class) . '" src="' . esc_url($url) . '"'; }
|
||||
function jio_format_number($number): string { return number_format((int) $number); }
|
||||
function jio_renderer_svg_icon(string $name): string { return '<svg class="zibsvg-' . esc_attr($name) . '" viewbox="0 0 16 16" aria-hidden="true"><use href="#zibsvg-' . esc_attr($name) . '"></use></svg>'; }
|
||||
function jio_renderer_collect_post_data(array $config = []): array {
|
||||
$post = $GLOBALS['discovery_current_post'];
|
||||
return ['post_id' => $post->ID, 'title' => '文章 ' . $post->ID, 'subtitle' => '', 'permalink' => 'https://example.test/post/' . $post->ID, 'time_ago' => '2天前', 'views' => 42, 'comments' => 3];
|
||||
}
|
||||
function aksrt_get_post_favorites(int $id): int { return 5; }
|
||||
function aksrt_get_post_likes(int $id): int { return 6; }
|
||||
function jio_get_post_favorites(int $id): int { return 5; }
|
||||
function jio_get_post_likes(int $id): int { return 6; }
|
||||
function get_term(int $id, string $taxonomy = 'category') { return $GLOBALS['discovery_terms'][$id] ?? new WP_Error('missing'); }
|
||||
function get_term_meta(int $id, string $key, bool $single = true): int { return $id === 7 ? 77 : 0; }
|
||||
function wp_get_attachment_url(int $id): string { return $id === 77 ? 'https://example.test/category-cover.jpg' : ''; }
|
||||
@@ -94,9 +94,9 @@ function get_the_post_thumbnail_url($id = null, string $size = 'post-thumbnail')
|
||||
function get_term_link(WP_Term $term) { return 'https://example.test/category/' . $term->term_id; }
|
||||
function current_user_can(string $capability): bool { return false; }
|
||||
function get_edit_term_link(int $id, string $taxonomy): string { return ''; }
|
||||
function aksrt_widget_str_cut(string $text, int $length): string { return $text; }
|
||||
function aksrt_render_placeholder(string $style, int $count): string { return '<div data-placeholder="' . esc_attr($style) . ':' . $count . '"></div>'; }
|
||||
function aksrt_render_post_list(array $args, WP_Query $query, bool $echo = true): string { return '<div class="rendered-post-count" data-count="' . count($query->posts) . '"></div>'; }
|
||||
function jio_widget_str_cut(string $text, int $length): string { return $text; }
|
||||
function jio_render_placeholder(string $style, int $count): string { return '<div data-placeholder="' . esc_attr($style) . ':' . $count . '"></div>'; }
|
||||
function jio_render_post_list(array $args, WP_Query $query, bool $echo = true): string { return '<div class="rendered-post-count" data-count="' . count($query->posts) . '"></div>'; }
|
||||
function get_terms(array $args) {
|
||||
$ids = array_map('intval', (array) ($args['include'] ?? []));
|
||||
if (($args['fields'] ?? '') === 'ids') return [];
|
||||
@@ -107,8 +107,8 @@ function get_queried_object() { return $GLOBALS['discovery_queried_term']; }
|
||||
function get_query_var(string $name, $default = '') { return $name === 'paged' ? $GLOBALS['discovery_paged'] : $default; }
|
||||
function get_ancestors(int $id, string $taxonomy, string $resource_type): array { return []; }
|
||||
function wp_parse_args_filter($args, array $defaults): array { return array_merge($defaults, $args); }
|
||||
function aksrt_homepage_get_current_url(): string { return 'https://example.test/?paged=3'; }
|
||||
function aksrt_homepage_url_del_paged(string $url): string { return preg_replace('/[?&]paged=\d+/', '', $url) ?: $url; }
|
||||
function jio_homepage_get_current_url(): string { return 'https://example.test/?paged=3'; }
|
||||
function jio_homepage_url_del_paged(string $url): string { return preg_replace('/[?&]paged=\d+/', '', $url) ?: $url; }
|
||||
function add_query_arg($args, $url = false): string {
|
||||
if (is_array($args)) return (string) $url . (str_contains((string) $url, '?') ? '&' : '?') . http_build_query($args);
|
||||
return 'https://example.test/';
|
||||
@@ -119,12 +119,12 @@ function get_template_directory_uri(): string { return 'https://example.test/the
|
||||
function wp_unslash($value): string { return (string) $value; }
|
||||
|
||||
require dirname(__DIR__, 2) . '/vendor/autoload.php';
|
||||
require dirname(__DIR__, 2) . '/inc/helpers/aksrt-graphic-card.php';
|
||||
require dirname(__DIR__, 2) . '/inc/helpers/aksrt-widgets-markup.php';
|
||||
require dirname(__DIR__, 2) . '/inc/helpers/aksrt-homepage.php';
|
||||
require dirname(__DIR__, 2) . '/inc/helpers/aksrt-archive-filters.php';
|
||||
require dirname(__DIR__, 2) . '/inc/helpers/jio-graphic-card.php';
|
||||
require dirname(__DIR__, 2) . '/inc/helpers/jio-widgets-markup.php';
|
||||
require dirname(__DIR__, 2) . '/inc/helpers/jio-homepage.php';
|
||||
require dirname(__DIR__, 2) . '/inc/helpers/jio-archive-filters.php';
|
||||
|
||||
use AKSRT\WidgetSystem\Renderers\ContentRenderer;
|
||||
use Jio\WidgetSystem\Renderers\ContentRenderer;
|
||||
|
||||
$aggregation = ContentRenderer::render('term_aggregation', [
|
||||
'term_id' => [7, 8], 'pc_row' => 2, 'orderby' => 'modified', 'order' => 'desc', 'count' => 2,
|
||||
@@ -132,14 +132,14 @@ $aggregation = ContentRenderer::render('term_aggregation', [
|
||||
$tabs = ContentRenderer::render('tab_posts', [
|
||||
'style' => 'list', 'count' => 2, 'paginate' => 'number',
|
||||
'tabs' => [['title' => '技术', 'cat' => '7'], ['title' => '空栏目', 'cat' => '8']],
|
||||
], ['widget_id' => 'aksrt_widget_tab_posts-4']);
|
||||
$posts = ContentRenderer::render('posts', ['style' => 'list', 'count' => 2, 'paginate' => 'number'], ['widget_id' => 'aksrt_widget_posts-3']);
|
||||
], ['widget_id' => 'jio_widget_tab_posts-4']);
|
||||
$posts = ContentRenderer::render('posts', ['style' => 'list', 'count' => 2, 'paginate' => 'number'], ['widget_id' => 'jio_widget_posts-3']);
|
||||
|
||||
$filter_group = aksrt_archive_build_term_filter_group('category', [
|
||||
$filter_group = jio_archive_build_term_filter_group('category', [
|
||||
'lists' => [7], 'dropdown' => true, 'dropdown_lists' => [9],
|
||||
], '分类');
|
||||
ob_start();
|
||||
aksrt_archive_render_filter_bar(['groups' => [$filter_group], 'aria_label' => '分类筛选']);
|
||||
jio_archive_render_filter_bar(['groups' => [$filter_group], 'aria_label' => '分类筛选']);
|
||||
$archive_filter_html = (string) ob_get_clean();
|
||||
|
||||
$GLOBALS['discovery_queried_term'] = $GLOBALS['discovery_terms'][7];
|
||||
@@ -147,7 +147,7 @@ $GLOBALS['wp_query'] = new WP_Query();
|
||||
$GLOBALS['wp_query']->found_posts = 31;
|
||||
$GLOBALS['discovery_paged'] = 1;
|
||||
ob_start();
|
||||
aksrt_archive_render_term_header([
|
||||
jio_archive_render_term_header([
|
||||
'header_style' => 'cover', 'show_cover' => true, 'cover_url' => '',
|
||||
'title' => '技术分类', 'description' => '首屏描述', 'post_count' => true,
|
||||
]);
|
||||
@@ -155,7 +155,7 @@ $term_header_first = (string) ob_get_clean();
|
||||
|
||||
$GLOBALS['discovery_paged'] = 2;
|
||||
ob_start();
|
||||
aksrt_archive_render_term_header([
|
||||
jio_archive_render_term_header([
|
||||
'header_style' => 'cover', 'show_cover' => true, 'cover_url' => '',
|
||||
'title' => '技术分类', 'description' => '第二页描述', 'post_count' => true,
|
||||
]);
|
||||
@@ -163,13 +163,13 @@ $term_header_second = (string) ob_get_clean();
|
||||
|
||||
$GLOBALS['discovery_paged'] = 1;
|
||||
ob_start();
|
||||
aksrt_archive_render_term_header([
|
||||
jio_archive_render_term_header([
|
||||
'header_style' => 'simple', 'show_cover' => false,
|
||||
'title' => '技术分类', 'description' => '简洁描述', 'post_count' => true,
|
||||
]);
|
||||
$term_header_simple = (string) ob_get_clean();
|
||||
|
||||
$home_sort = aksrt_homepage_get_option_orderby_but(['lists' => ['date', 'views'], 'dropdown' => true]);
|
||||
$home_sort = jio_homepage_get_option_orderby_but(['lists' => ['date', 'views'], 'dropdown' => true]);
|
||||
|
||||
$result = json_encode([
|
||||
'aggregation' => $aggregation,
|
||||
|
||||
Reference in new issue
Block a user