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,16 +2,16 @@
|
||||
/**
|
||||
* Homepage queries, sidebars, post stream, and pagination.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!function_exists('aksrt_homepage_get_latest_query')) {
|
||||
if (!function_exists('jio_homepage_get_latest_query')) {
|
||||
/**
|
||||
* Homepage main-stream query.
|
||||
*/
|
||||
function aksrt_homepage_get_latest_query(): WP_Query {
|
||||
function jio_homepage_get_latest_query(): WP_Query {
|
||||
static $query = null;
|
||||
|
||||
if ($query instanceof WP_Query) {
|
||||
@@ -19,48 +19,48 @@ if (!function_exists('aksrt_homepage_get_latest_query')) {
|
||||
}
|
||||
|
||||
$query_args = [
|
||||
'post_type' => aksrt_homepage_get_post_types(),
|
||||
'post_type' => jio_homepage_get_post_types(),
|
||||
'post_status' => 'publish',
|
||||
'posts_per_page' => max(1, (int) get_option('posts_per_page')),
|
||||
'paged' => aksrt_homepage_get_current_page(),
|
||||
'paged' => jio_homepage_get_current_page(),
|
||||
'ignore_sticky_posts' => false,
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
'no_found_rows' => false,
|
||||
];
|
||||
|
||||
$exclude_ids = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::home_exclude_post_ids()
|
||||
$exclude_ids = class_exists('\Jio\Settings\Settings')
|
||||
? \Jio\Settings\Settings::home_exclude_post_ids()
|
||||
: [];
|
||||
if (!empty($exclude_ids)) {
|
||||
$query_args['post__not_in'] = $exclude_ids;
|
||||
}
|
||||
|
||||
$exclude_cat_ids = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::home_exclude_category_ids()
|
||||
$exclude_cat_ids = class_exists('\Jio\Settings\Settings')
|
||||
? \Jio\Settings\Settings::home_exclude_category_ids()
|
||||
: [];
|
||||
if (!empty($exclude_cat_ids)) {
|
||||
$query_args['category__not_in'] = $exclude_cat_ids;
|
||||
}
|
||||
|
||||
// legacy zib_sift_posts_per_orde:排序菜单的 ?orderby= 优先于后台默认排序。
|
||||
$request_sort = aksrt_homepage_get_request_sort();
|
||||
$request_sort = jio_homepage_get_request_sort();
|
||||
$query = new WP_Query(
|
||||
$request_sort !== ''
|
||||
? aksrt_homepage_apply_named_sort_args($query_args, $request_sort)
|
||||
: aksrt_homepage_apply_sort_args($query_args)
|
||||
? jio_homepage_apply_named_sort_args($query_args, $request_sort)
|
||||
: jio_homepage_apply_sort_args($query_args)
|
||||
);
|
||||
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
if (!function_exists('aksrt_homepage_has_active_sidebars')) {
|
||||
if (!function_exists('jio_homepage_has_active_sidebars')) {
|
||||
/**
|
||||
* Check whether any sidebar in the given stack is active.
|
||||
*
|
||||
* @param string[] $sidebar_ids
|
||||
*/
|
||||
function aksrt_homepage_has_active_sidebars(array $sidebar_ids): bool {
|
||||
function jio_homepage_has_active_sidebars(array $sidebar_ids): bool {
|
||||
foreach ($sidebar_ids as $sidebar_id) {
|
||||
if (is_active_sidebar($sidebar_id)) {
|
||||
return true;
|
||||
@@ -71,15 +71,15 @@ if (!function_exists('aksrt_homepage_has_active_sidebars')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_homepage_render_widget_zone')) {
|
||||
if (!function_exists('jio_homepage_render_widget_zone')) {
|
||||
/**
|
||||
* Render a stacked widget zone.
|
||||
*
|
||||
* @param string[] $sidebar_ids
|
||||
* @param string $wrapper_class
|
||||
*/
|
||||
function aksrt_homepage_render_widget_zone(array $sidebar_ids, string $wrapper_class = ''): void {
|
||||
if (!aksrt_homepage_has_active_sidebars($sidebar_ids)) {
|
||||
function jio_homepage_render_widget_zone(array $sidebar_ids, string $wrapper_class = ''): void {
|
||||
if (!jio_homepage_has_active_sidebars($sidebar_ids)) {
|
||||
wp_reset_postdata();
|
||||
return;
|
||||
}
|
||||
@@ -94,19 +94,19 @@ if (!function_exists('aksrt_homepage_render_widget_zone')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_homepage_render_sidebar')) {
|
||||
if (!function_exists('jio_homepage_render_sidebar')) {
|
||||
/**
|
||||
* Render the homepage aside column.
|
||||
*
|
||||
* Visibility is aksrt_is_show_sidebar() alone; its filter already
|
||||
* Visibility is jio_is_show_sidebar() alone; its filter already
|
||||
* collapses the layout when the sidebar widget stack is empty.
|
||||
*/
|
||||
function aksrt_homepage_render_sidebar(): void {
|
||||
if (!aksrt_is_show_sidebar()) {
|
||||
function jio_homepage_render_sidebar(): void {
|
||||
if (!jio_is_show_sidebar()) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo '<div class="sidebar aksrt-homepage__aside" role="complementary" aria-label="' . esc_attr__('Homepage Sidebar', 'aksrt') . '">';
|
||||
echo '<div class="sidebar jio-homepage__aside" role="complementary" aria-label="' . esc_attr__('Homepage Sidebar', 'jio') . '">';
|
||||
|
||||
if (is_active_sidebar('all_sidebar_top')) {
|
||||
dynamic_sidebar('all_sidebar_top');
|
||||
@@ -124,14 +124,14 @@ if (!function_exists('aksrt_homepage_render_sidebar')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_homepage_get_latest_panel_contract')) {
|
||||
if (!function_exists('jio_homepage_get_latest_panel_contract')) {
|
||||
/**
|
||||
* Public-safe latest stream contract shared by homepage pagination/AJAX.
|
||||
*
|
||||
* @return array{query_context:string,query_vars:string,render_config:string,render_config_array:array<string,mixed>}
|
||||
*/
|
||||
function aksrt_homepage_get_latest_panel_contract(): array {
|
||||
$query = aksrt_homepage_get_latest_query();
|
||||
function jio_homepage_get_latest_panel_contract(): array {
|
||||
$query = jio_homepage_get_latest_query();
|
||||
$query_vars = $query instanceof WP_Query ? $query->query_vars : [];
|
||||
if (!is_array($query_vars)) {
|
||||
$query_vars = [];
|
||||
@@ -139,7 +139,7 @@ if (!function_exists('aksrt_homepage_get_latest_panel_contract')) {
|
||||
|
||||
unset($query_vars['paged'], $query_vars['page']);
|
||||
|
||||
$render_config = aksrt_resolve_post_list_render_config(['context' => 'home']);
|
||||
$render_config = jio_resolve_post_list_render_config(['context' => 'home']);
|
||||
$render_config['skip_wrapper'] = true;
|
||||
|
||||
return [
|
||||
@@ -151,24 +151,24 @@ if (!function_exists('aksrt_homepage_get_latest_panel_contract')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_homepage_render_pagination')) {
|
||||
if (!function_exists('jio_homepage_render_pagination')) {
|
||||
/**
|
||||
* Render pagination for the fixed homepage latest stream.
|
||||
*/
|
||||
function aksrt_homepage_render_pagination(WP_Query $query): void {
|
||||
function jio_homepage_render_pagination(WP_Query $query): void {
|
||||
$max_pages = (int) $query->max_num_pages;
|
||||
if ($max_pages < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
$query_page = (int) $query->get('paged');
|
||||
$current_page = min(max(1, $query_page > 0 ? $query_page : aksrt_homepage_get_current_page()), $max_pages);
|
||||
$pagination_mode = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_post_pagination_mode()
|
||||
$current_page = min(max(1, $query_page > 0 ? $query_page : jio_homepage_get_current_page()), $max_pages);
|
||||
$pagination_mode = class_exists('\Jio\Settings\Settings')
|
||||
? \Jio\Settings\Settings::get_post_pagination_mode()
|
||||
: 'numbered';
|
||||
|
||||
if ($pagination_mode === 'numbered') {
|
||||
$base_url = (string) get_query_var('aksrt_homepage_pagination_base_url');
|
||||
$base_url = (string) get_query_var('jio_homepage_pagination_base_url');
|
||||
$base_args = [
|
||||
'format' => '',
|
||||
'current' => $current_page,
|
||||
@@ -194,7 +194,7 @@ if (!function_exists('aksrt_homepage_render_pagination')) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<nav class="navigation pagination" aria-label="<?php esc_attr_e('Posts', 'aksrt'); ?>">
|
||||
<nav class="navigation pagination" aria-label="<?php esc_attr_e('Posts', 'jio'); ?>">
|
||||
<div class="nav-links">
|
||||
<?php foreach ($links as $link) : ?>
|
||||
<?php echo wp_kses_post($link); ?>
|
||||
@@ -205,8 +205,8 @@ if (!function_exists('aksrt_homepage_render_pagination')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$contract = aksrt_homepage_get_latest_panel_contract();
|
||||
aksrt_render_pagination($query, [
|
||||
$contract = jio_homepage_get_latest_panel_contract();
|
||||
jio_render_pagination($query, [
|
||||
'query_context' => $contract['query_context'],
|
||||
'render_config' => $contract['render_config_array'],
|
||||
'current_page' => $current_page,
|
||||
@@ -214,13 +214,13 @@ if (!function_exists('aksrt_homepage_render_pagination')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_get_post_gallery_images')) {
|
||||
if (!function_exists('jio_get_post_gallery_images')) {
|
||||
/**
|
||||
* Collect gallery images for homepage mult-thumb cards.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
function aksrt_get_post_gallery_images(int $post_id, int $limit = 4): array {
|
||||
function jio_get_post_gallery_images(int $post_id, int $limit = 4): array {
|
||||
static $request_cache = [];
|
||||
|
||||
$post_id = max(0, $post_id);
|
||||
@@ -235,7 +235,7 @@ if (!function_exists('aksrt_get_post_gallery_images')) {
|
||||
}
|
||||
|
||||
$modified_gmt = (string) get_post_field('post_modified_gmt', $post_id);
|
||||
$transient_key = 'aksrt_home_gallery_' . $post_id . '_' . md5($modified_gmt !== '' ? $modified_gmt : (string) $post_id);
|
||||
$transient_key = 'jio_home_gallery_' . $post_id . '_' . md5($modified_gmt !== '' ? $modified_gmt : (string) $post_id);
|
||||
$cached_images = get_transient($transient_key);
|
||||
|
||||
if (is_array($cached_images)) {
|
||||
@@ -278,20 +278,20 @@ if (!function_exists('aksrt_get_post_gallery_images')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_homepage_render_posts_grid')) {
|
||||
if (!function_exists('jio_homepage_render_posts_grid')) {
|
||||
/**
|
||||
* Render a list block for the fixed homepage.
|
||||
*/
|
||||
function aksrt_homepage_render_posts_grid(?WP_Query $query = null, bool $with_pagination = false): void {
|
||||
$query = $query instanceof WP_Query ? $query : aksrt_homepage_get_latest_query();
|
||||
$config = aksrt_resolve_post_list_render_config(['context' => 'home']);
|
||||
function jio_homepage_render_posts_grid(?WP_Query $query = null, bool $with_pagination = false): void {
|
||||
$query = $query instanceof WP_Query ? $query : jio_homepage_get_latest_query();
|
||||
$config = jio_resolve_post_list_render_config(['context' => 'home']);
|
||||
$config['skip_wrapper'] = true;
|
||||
|
||||
// Panel already provides posts-row.ajaxpager; avoid nested wrapper.
|
||||
aksrt_render_post_list($config, $query, true);
|
||||
jio_render_post_list($config, $query, true);
|
||||
|
||||
if ($with_pagination) {
|
||||
aksrt_homepage_render_pagination($query);
|
||||
jio_homepage_render_pagination($query);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user