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

@@ -1,117 +0,0 @@
<?php
/**
* Layout-2 menu search remote panel (legacy menu_search / legacy).
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_ajax_menu_search')) :
/**
* AJAX: HTML panel for navbar inline search (history + hot + posts).
*/
function aksrt_ajax_menu_search(): void {
$nonce = isset($_REQUEST['nonce'])
? sanitize_text_field(wp_unslash((string) $_REQUEST['nonce']))
: '';
if (!wp_verify_nonce($nonce, 'aksrt_public_nonce')) {
wp_die('0');
}
if (!function_exists('aksrt_get_search_box')) {
wp_die('0');
}
$show_keywords = true;
$show_history = true;
$show_posts = true;
if (class_exists('\AKSRT\Settings\Settings')) {
$show_keywords = method_exists('\AKSRT\Settings\Settings', 'hot_search_enabled')
? (bool) \AKSRT\Settings\Settings::hot_search_enabled()
: true;
$show_history = method_exists('\AKSRT\Settings\Settings', 'search_history_enabled')
? (bool) \AKSRT\Settings\Settings::search_history_enabled()
: true;
$show_posts = method_exists('\AKSRT\Settings\Settings', 'search_posts_enabled')
? (bool) \AKSRT\Settings\Settings::search_posts_enabled()
: !empty(\AKSRT\Settings\Settings::get_value('search_posts', true));
}
$search = aksrt_get_search_box([
'show_form' => false,
'show_keywords' => $show_keywords,
'show_history' => $show_history,
'show_posts' => $show_posts,
]);
if ($search === '' || $search === null) {
wp_die('0');
}
// legacy contract: outer dropdown + inner .search-input.
echo '<div class="dropdown-menu hover-show-con">' . $search . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
wp_die();
}
endif;
if (!function_exists('aksrt_ajax_search_box')) :
/**
* AJAX: full legacy search box loaded into the footer shell on first open.
*/
function aksrt_ajax_search_box(): void {
$nonce = isset($_REQUEST['nonce'])
? sanitize_text_field(wp_unslash((string) $_REQUEST['nonce']))
: '';
if (!wp_verify_nonce($nonce, 'aksrt_public_nonce') || !function_exists('aksrt_get_search_box')) {
wp_die('0');
}
echo aksrt_get_search_box([ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
'show_form' => true,
'show_keywords' => !class_exists('\\AKSRT\\Settings\\Settings') || \AKSRT\Settings\Settings::hot_search_enabled(),
'show_history' => !class_exists('\\AKSRT\\Settings\\Settings') || \AKSRT\Settings\Settings::search_history_enabled(),
'show_posts' => !class_exists('\\AKSRT\\Settings\\Settings') || \AKSRT\Settings\Settings::search_posts_enabled(),
'show_type' => !class_exists('\\AKSRT\\Settings\\Settings') || (bool) \AKSRT\Settings\Settings::get_value('search_type', true),
'show_input_cat' => !class_exists('\\AKSRT\\Settings\\Settings') || \AKSRT\Settings\Settings::search_cat_enabled(),
]);
wp_die();
}
endif;
if (!function_exists('aksrt_footer_navbar_search')) :
/**
* legacy footer search shell. The heavy search body is loaded once via remote-box.
*/
function aksrt_footer_navbar_search(): void {
$show_on_404 = class_exists('\\AKSRT\\Settings\\Settings')
? (bool) \AKSRT\Settings\Settings::get_value('404_search_s', true)
: true;
if (is_search() || (is_404() && $show_on_404)) {
return;
}
$remote = aksrt_get_remote_box([
'type' => 'click',
'class' => '',
'loader' => '<div class="search-input"><p><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i></p><p class="placeholder k2"></p><p class="placeholder t1"></p><p><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i></p><p class="placeholder k1"></p><p class="placeholder t1"></p><p></p><p class="placeholder k1" style="height:80px;"></p></div>',
'query' => [
'action' => 'search_box',
'nonce' => wp_create_nonce('aksrt_public_nonce'),
],
]);
echo '<div mini-touch="nav_search" touch-direction="top" class="main-search fixed-body main-bg box-body navbar-search nopw-sm">';
echo '<div class="container">';
echo $remote; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '<div class="mb20 search-close-box"><button type="button" class="but cir" data-toggle-class data-target=".navbar-search" aria-label="'
. esc_attr__('关闭搜索', 'aksrt') . '"><svg class="ic-close" aria-hidden="true"><use xlink:href="#icon-close"></use></svg></button></div>';
echo '</div></div>';
}
endif;
add_action('wp_ajax_menu_search', 'aksrt_ajax_menu_search');
add_action('wp_ajax_nopriv_menu_search', 'aksrt_ajax_menu_search');
add_action('wp_ajax_search_box', 'aksrt_ajax_search_box');
add_action('wp_ajax_nopriv_search_box', 'aksrt_ajax_search_box');
add_action('wp_footer', 'aksrt_footer_navbar_search', 10);
@@ -0,0 +1,117 @@
<?php
/**
* Layout-2 menu search remote panel (legacy menu_search / legacy).
*
* @package Jio
*/
defined('ABSPATH') || exit;
if (!function_exists('jio_ajax_menu_search')) :
/**
* AJAX: HTML panel for navbar inline search (history + hot + posts).
*/
function jio_ajax_menu_search(): void {
$nonce = isset($_REQUEST['nonce'])
? sanitize_text_field(wp_unslash((string) $_REQUEST['nonce']))
: '';
if (!wp_verify_nonce($nonce, 'jio_public_nonce')) {
wp_die('0');
}
if (!function_exists('jio_get_search_box')) {
wp_die('0');
}
$show_keywords = true;
$show_history = true;
$show_posts = true;
if (class_exists('\Jio\Settings\Settings')) {
$show_keywords = method_exists('\Jio\Settings\Settings', 'hot_search_enabled')
? (bool) \Jio\Settings\Settings::hot_search_enabled()
: true;
$show_history = method_exists('\Jio\Settings\Settings', 'search_history_enabled')
? (bool) \Jio\Settings\Settings::search_history_enabled()
: true;
$show_posts = method_exists('\Jio\Settings\Settings', 'search_posts_enabled')
? (bool) \Jio\Settings\Settings::search_posts_enabled()
: !empty(\Jio\Settings\Settings::get_value('search_posts', true));
}
$search = jio_get_search_box([
'show_form' => false,
'show_keywords' => $show_keywords,
'show_history' => $show_history,
'show_posts' => $show_posts,
]);
if ($search === '' || $search === null) {
wp_die('0');
}
// legacy contract: outer dropdown + inner .search-input.
echo '<div class="dropdown-menu hover-show-con">' . $search . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
wp_die();
}
endif;
if (!function_exists('jio_ajax_search_box')) :
/**
* AJAX: full legacy search box loaded into the footer shell on first open.
*/
function jio_ajax_search_box(): void {
$nonce = isset($_REQUEST['nonce'])
? sanitize_text_field(wp_unslash((string) $_REQUEST['nonce']))
: '';
if (!wp_verify_nonce($nonce, 'jio_public_nonce') || !function_exists('jio_get_search_box')) {
wp_die('0');
}
echo jio_get_search_box([ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
'show_form' => true,
'show_keywords' => !class_exists('\\Jio\\Settings\\Settings') || \Jio\Settings\Settings::hot_search_enabled(),
'show_history' => !class_exists('\\Jio\\Settings\\Settings') || \Jio\Settings\Settings::search_history_enabled(),
'show_posts' => !class_exists('\\Jio\\Settings\\Settings') || \Jio\Settings\Settings::search_posts_enabled(),
'show_type' => !class_exists('\\Jio\\Settings\\Settings') || (bool) \Jio\Settings\Settings::get_value('search_type', true),
'show_input_cat' => !class_exists('\\Jio\\Settings\\Settings') || \Jio\Settings\Settings::search_cat_enabled(),
]);
wp_die();
}
endif;
if (!function_exists('jio_footer_navbar_search')) :
/**
* legacy footer search shell. The heavy search body is loaded once via remote-box.
*/
function jio_footer_navbar_search(): void {
$show_on_404 = class_exists('\\Jio\\Settings\\Settings')
? (bool) \Jio\Settings\Settings::get_value('404_search_s', true)
: true;
if (is_search() || (is_404() && $show_on_404)) {
return;
}
$remote = jio_get_remote_box([
'type' => 'click',
'class' => '',
'loader' => '<div class="search-input"><p><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i></p><p class="placeholder k2"></p><p class="placeholder t1"></p><p><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i></p><p class="placeholder k1"></p><p class="placeholder t1"></p><p></p><p class="placeholder k1" style="height:80px;"></p></div>',
'query' => [
'action' => 'search_box',
'nonce' => wp_create_nonce('jio_public_nonce'),
],
]);
echo '<div mini-touch="nav_search" touch-direction="top" class="main-search fixed-body main-bg box-body navbar-search nopw-sm">';
echo '<div class="container">';
echo $remote; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '<div class="mb20 search-close-box"><button type="button" class="but cir" data-toggle-class data-target=".navbar-search" aria-label="'
. esc_attr__('关闭搜索', 'jio') . '"><svg class="ic-close" aria-hidden="true"><use xlink:href="#icon-close"></use></svg></button></div>';
echo '</div></div>';
}
endif;
add_action('wp_ajax_menu_search', 'jio_ajax_menu_search');
add_action('wp_ajax_nopriv_menu_search', 'jio_ajax_menu_search');
add_action('wp_ajax_search_box', 'jio_ajax_search_box');
add_action('wp_ajax_nopriv_search_box', 'jio_ajax_search_box');
add_action('wp_footer', 'jio_footer_navbar_search', 10);
@@ -2,18 +2,18 @@
/**
* Mobile drawer (legacy + mobile-header shell).
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_nav_mobile_shell')) :
if (!function_exists('jio_nav_mobile_shell')) :
/**
* Full mobile header drawer + fixed-body.
*
* @param array<string,mixed> $ctx
*/
function aksrt_nav_mobile_shell(array $ctx): void {
function jio_nav_mobile_shell(array $ctx): void {
$align = (string) ($ctx['mobile_align'] ?? 'left');
if (!in_array($align, ['top', 'left', 'right'], true)) {
$align = 'left';
@@ -35,10 +35,10 @@ if (!function_exists('aksrt_nav_mobile_shell')) :
echo '<div class="flex jsb ac mb20">';
echo '<div class="navbar-logo">' . $logo_inner . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '<button type="button" data-toggle-class="mobile-navbar-show" data-target="body" class="close" aria-label="'
. esc_attr__('关闭菜单', 'aksrt') . '"><svg class="ic-close" aria-hidden="true"><use xlink:href="#icon-close"></use></svg></button>';
. esc_attr__('关闭菜单', 'jio') . '"><svg class="ic-close" aria-hidden="true"><use xlink:href="#icon-close"></use></svg></button>';
echo '</div>';
aksrt_nav_mobile_content($ctx);
jio_nav_mobile_content($ctx);
if (is_active_sidebar('mobile_nav_fluid')) {
echo '<div class="mobile-nav-widget">';
@@ -52,34 +52,34 @@ if (!function_exists('aksrt_nav_mobile_shell')) :
}
endif;
if (!function_exists('aksrt_nav_mobile_content')) :
if (!function_exists('jio_nav_mobile_content')) :
/**
* Mobile menu list + top toggles + user box.
*
* @param array<string,mixed> $ctx
*/
function aksrt_nav_mobile_content(array $ctx): void {
function jio_nav_mobile_content(array $ctx): void {
$top_btns = '';
if (in_array('m_menu', (array) ($ctx['theme_positions'] ?? []), true)) {
$top_btns .= '<a href="javascript:;" class="toggle-theme toggle-radius" id="theme-toggle-mobile" title="'
. esc_attr__('切换亮暗色', 'aksrt') . '">';
. esc_attr__('切换亮暗色', 'jio') . '">';
$top_btns .= '<i class="fa far fa-toggle-theme" aria-hidden="true"></i>';
$top_btns .= '</a>';
}
if ('center' !== ($ctx['mobile_layout'] ?? 'center')) {
$top_btns .= '<a href="javascript:;" class="toggle-radius main-search-btn" aria-label="'
. esc_attr__('打开搜索', 'aksrt') . '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-search"></use></svg></a>';
. esc_attr__('打开搜索', 'jio') . '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-search"></use></svg></a>';
}
if (function_exists('aksrt_get_translate_language_btn')) {
$top_btns .= aksrt_get_translate_language_btn('pull-right');
if (function_exists('jio_get_translate_language_btn')) {
$top_btns .= jio_get_translate_language_btn('pull-right');
}
if ($top_btns !== '') {
echo '<div class="flex ac pull-right" style="margin-right: -3px;">' . $top_btns . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
$location = has_nav_menu('mobile') ? 'mobile' : 'primary';
$walker = class_exists('\AKSRT\Frontend\NavWalker')
? new \AKSRT\Frontend\NavWalker()
$walker = class_exists('\Jio\Frontend\NavWalker')
? new \Jio\Frontend\NavWalker()
: null;
$args = [
@@ -101,22 +101,22 @@ if (!function_exists('aksrt_nav_mobile_content')) :
}
if ($menu === '' && is_super_admin()) {
$menu = '<ul class="mobile-menus theme-box"><li><a href="' . esc_url(admin_url('nav-menus.php')) . '">'
. esc_html__('添加导航菜单', 'aksrt') . '</a></li></ul>';
. esc_html__('添加导航菜单', 'jio') . '</a></li></ul>';
}
echo $menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if (is_singular('post')) {
$page = class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::get_post_page_settings()
$page = class_exists('\Jio\Settings\Settings')
? \Jio\Settings\Settings::get_post_page_settings()
: [];
$article_nav = !isset($page['article_nav']) || !empty($page['article_nav']);
$article_nav_mobile = !isset($page['article_nav_mobile']) || !empty($page['article_nav_mobile']);
if ($article_nav && $article_nav_mobile) {
echo '<div class="posts-nav-box" data-title="' . esc_attr__('文章目录', 'aksrt') . '"></div>';
echo '<div class="posts-nav-box" data-title="' . esc_attr__('文章目录', 'jio') . '"></div>';
}
}
// User box at bottom of drawer.
echo aksrt_header_user_box_html($ctx); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo jio_header_user_box_html($ctx); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
endif;
@@ -2,12 +2,12 @@
/**
* Desktop navbar pieces (legacy navbar header / menu / buttons).
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_menu_items')) :
if (!function_exists('jio_menu_items')) :
/**
* PC top menu (legacy).
*
@@ -15,9 +15,9 @@ if (!function_exists('aksrt_menu_items')) :
* @param bool $echo Echo or return.
* @return string|void
*/
function aksrt_menu_items(string $location = 'primary', bool $echo = true) {
$walker = class_exists('\AKSRT\Frontend\NavWalker')
? new \AKSRT\Frontend\NavWalker()
function jio_menu_items(string $location = 'primary', bool $echo = true) {
$walker = class_exists('\Jio\Frontend\NavWalker')
? new \Jio\Frontend\NavWalker()
: null;
$args = [
@@ -43,7 +43,7 @@ if (!function_exists('aksrt_menu_items')) :
if ($menu === '' && is_super_admin()) {
$menu = '<ul class="nav navbar-nav"><li><a href="' . esc_url(admin_url('nav-menus.php')) . '">'
. esc_html__('添加导航菜单', 'aksrt') . '</a></li></ul>';
. esc_html__('添加导航菜单', 'jio') . '</a></li></ul>';
}
if ($echo) {
@@ -54,13 +54,13 @@ if (!function_exists('aksrt_menu_items')) :
}
endif;
if (!function_exists('aksrt_navbar_header')) :
if (!function_exists('jio_navbar_header')) :
/**
* Logo + mobile toggles (legacy).
*
* @param array<string,mixed> $ctx
*/
function aksrt_navbar_header(array $ctx): void {
function jio_navbar_header(array $ctx): void {
$brand_name = (string) ($ctx['brand_name'] ?? get_bloginfo('name'));
$logo_inner = !empty($ctx['logo_html'])
? $ctx['logo_html']
@@ -69,11 +69,11 @@ if (!function_exists('aksrt_navbar_header')) :
$logo = '<a class="navbar-logo" href="' . esc_url(home_url('/')) . '">' . $logo_inner . '</a>';
$button = '<button type="button" data-toggle-class="mobile-navbar-show" data-target="body" class="navbar-toggle" aria-label="'
. esc_attr__('打开菜单', 'aksrt') . '">';
. esc_attr__('打开菜单', 'jio') . '">';
$button .= '<i class="em12 css-icon i-menu"><i></i></i></button>';
if ('center' === ($ctx['mobile_layout'] ?? 'center')) {
$button .= '<a href="javascript:;" class="navbar-toggle main-search-btn" aria-label="'
. esc_attr__('打开搜索', 'aksrt') . '">';
. esc_attr__('打开搜索', 'jio') . '">';
$button .= '<svg class="icon" aria-hidden="true"><use xlink:href="#icon-search"></use></svg></a>';
}
@@ -84,17 +84,17 @@ if (!function_exists('aksrt_navbar_header')) :
}
endif;
if (!function_exists('aksrt_get_menu_search')) :
if (!function_exists('jio_get_menu_search')) :
/**
* Layout-2 inline search form (legacy simplified).
*
* @param array<string,mixed> $ctx
*/
function aksrt_get_menu_search(array $ctx): void {
function jio_get_menu_search(array $ctx): void {
if (is_search()) {
return;
}
$placeholder = (string) ($ctx['search_placeholder'] ?? __('搜索内容', 'aksrt'));
$placeholder = (string) ($ctx['search_placeholder'] ?? __('搜索内容', 'jio'));
// legacy: form + input + remote-box (action=menu_search).
echo '<form method="get" class="navbar-form navbar-left hover-show" action="' . esc_url(home_url('/')) . '">';
@@ -102,20 +102,20 @@ if (!function_exists('aksrt_get_menu_search')) :
echo '<input type="text" class="form-control search-input focus-show" name="s" value="'
. esc_attr(get_search_query()) . '" placeholder="' . esc_attr($placeholder) . '" autocomplete="off">';
echo '<div class="abs-right muted-3-color"><button type="submit" class="null" aria-label="'
. esc_attr__('搜索', 'aksrt') . '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-search"></use></svg></button></div>';
if (function_exists('aksrt_get_remote_box')) {
echo aksrt_get_remote_box([ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
. esc_attr__('搜索', 'jio') . '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-search"></use></svg></button></div>';
if (function_exists('jio_get_remote_box')) {
echo jio_get_remote_box([ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
'class' => '',
'loader' => ' ',
'query' => [
'action' => 'menu_search',
'nonce' => wp_create_nonce('aksrt_public_nonce'),
'nonce' => wp_create_nonce('jio_public_nonce'),
],
]);
} else {
$remote_url = add_query_arg([
'action' => 'menu_search',
'nonce' => wp_create_nonce('aksrt_public_nonce'),
'nonce' => wp_create_nonce('jio_public_nonce'),
], admin_url('admin-ajax.php'));
echo '<div class="lazyload" remote-box="' . esc_url($remote_url) . '" lazyload-action="ias">';
echo '<i class="loading-spot"><i></i></i></div>';
@@ -124,13 +124,13 @@ if (!function_exists('aksrt_get_menu_search')) :
}
endif;
if (!function_exists('aksrt_header_user_box_html')) :
if (!function_exists('jio_header_user_box_html')) :
/**
* User dropdown inner content for nav sub-menu (logged-in / guest).
*
* @param array<string,mixed> $ctx
*/
function aksrt_header_user_box_html(array $ctx): string {
function jio_header_user_box_html(array $ctx): string {
static $html = null;
if ($html !== null) {
return $html;
@@ -142,41 +142,41 @@ if (!function_exists('aksrt_header_user_box_html')) :
if ($user_id > 0) {
$user = $ctx['current_user'] instanceof WP_User ? $ctx['current_user'] : wp_get_current_user();
$display_name = $user->display_name ?: $user->user_login;
$avatar = aksrt_get_avatar_box($user_id, 'avatar-img', true, false);
$avatar = jio_get_avatar_box($user_id, 'avatar-img', true, false);
$desc = (string) ($ctx['user_desc'] ?? '');
$vip_badge = function_exists('aksrt_get_vip_icon') ? aksrt_get_vip_icon($user_id) : '';
$vip_badge = function_exists('jio_get_vip_icon') ? jio_get_vip_icon($user_id) : '';
// Level and certification icons ride inline to the right of the display name.
$level_badge = (class_exists('\AKSRT\User\Level') && method_exists('\AKSRT\User\Level', 'get_badge_html'))
? \AKSRT\User\Level::get_badge_html($user_id, 'aksrt-user-level-icon--header')
$level_badge = (class_exists('\Jio\User\Level') && method_exists('\Jio\User\Level', 'get_badge_html'))
? \Jio\User\Level::get_badge_html($user_id, 'jio-user-level-icon--header')
: '';
$medal_badge = function_exists('aksrt_get_worn_medal_icon')
? aksrt_get_worn_medal_icon($user_id, 'aksrt-header-user-medal')
$medal_badge = function_exists('jio_get_worn_medal_icon')
? jio_get_worn_medal_icon($user_id, 'jio-header-user-medal')
: '';
$certification_badge = '';
if (function_exists('aksrt_get_user_identity_signals')) {
foreach (aksrt_get_user_identity_signals($user_id) as $signal) {
if (function_exists('jio_get_user_identity_signals')) {
foreach (jio_get_user_identity_signals($user_id) as $signal) {
if ((string) ($signal['type'] ?? '') !== 'verify') {
continue;
}
$icon_url = esc_url((string) ($signal['icon_url'] ?? ''));
$title = (string) ($signal['title'] ?? $signal['label'] ?? '');
if ($icon_url !== '' && $title !== '') {
$certification_badge = '<img' . aksrt_get_lazy_attr('lazy_other', $icon_url, 'aksrt-identity-certification-icon img-icon ml3') . ' alt="" title="' . esc_attr($title) . '" decoding="async">';
$certification_badge = '<img' . jio_get_lazy_attr('lazy_other', $icon_url, 'jio-identity-certification-icon img-icon ml3') . ' alt="" title="' . esc_attr($title) . '" decoding="async">';
}
break;
}
}
$payvip = function_exists('aksrt_header_payvip_bar') ? aksrt_header_payvip_bar($user_id) : '';
$checkin = function_exists('aksrt_header_user_checkin_btn') ? aksrt_header_user_checkin_btn($user_id) : '';
$wallet = function_exists('aksrt_header_user_wallet_mini') ? aksrt_header_user_wallet_mini($user_id) : '';
$badges = function_exists('aksrt_header_user_badges_row') ? aksrt_header_user_badges_row($user_id) : '';
$payvip = function_exists('jio_header_payvip_bar') ? jio_header_payvip_bar($user_id) : '';
$checkin = function_exists('jio_header_user_checkin_btn') ? jio_header_user_checkin_btn($user_id) : '';
$wallet = function_exists('jio_header_user_wallet_mini') ? jio_header_user_wallet_mini($user_id) : '';
$badges = function_exists('jio_header_user_badges_row') ? jio_header_user_badges_row($user_id) : '';
$unread = (int) ($ctx['unread_count'] ?? 0);
$msg_url = (string) ($ctx['messages_url'] ?? '');
$positions = (array) ($ctx['message_icon_positions'] ?? []);
$msg_icon = '';
if ($msg_url !== '' && in_array('avatar_dropdown', $positions, true)) {
$msg_icon = '<a class="msg-news-icon abs-right" href="' . esc_url($msg_url) . '" title="' . esc_attr__('消息中心', 'aksrt') . '">';
$msg_icon = '<a class="msg-news-icon abs-right" href="' . esc_url($msg_url) . '" title="' . esc_attr__('消息中心', 'jio') . '">';
$msg_icon .= '<span class="toggle-radius msg-icon"><i class="fa fas fa-bell" aria-hidden="true"></i></span>';
if ($unread > 0) {
$msg_icon .= '<badge class="top">' . esc_html((string) min(99, $unread)) . '</badge>';
@@ -185,26 +185,26 @@ if (!function_exists('aksrt_header_user_box_html')) :
}
$href = '<div class="flex jsa header-user-href">';
$href .= '<a rel="nofollow" href="' . esc_url(function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url() : home_url('/')) . '">';
$href .= '<a rel="nofollow" href="' . esc_url(function_exists('jio_get_user_center_url') ? jio_get_user_center_url() : home_url('/')) . '">';
$href .= '<div class="badg mb6 toggle-radius c-blue"><i class="fa fas fa-user" aria-hidden="true"></i></div>';
$href .= '<div class="c-blue">' . esc_html__('用户中心', 'aksrt') . '</div></a>';
$href .= '<div class="c-blue">' . esc_html__('用户中心', 'jio') . '</div></a>';
$orders = (string) ($ctx['orders_url'] ?? '');
if ($orders !== '') {
$href .= '<a rel="nofollow" href="' . esc_url($orders) . '">';
$href .= '<div class="badg mb6 toggle-radius c-purple"><i class="fa fas fa-shopping-bag" aria-hidden="true"></i></div>';
$href .= '<div class="c-purple">' . esc_html__('我的订单', 'aksrt') . '</div></a>';
$href .= '<div class="c-purple">' . esc_html__('我的订单', 'jio') . '</div></a>';
}
if (!empty($ctx['can_publish'])) {
// legacy:用户卡片发布按钮由 nav_user_newposts_btn 门控,文案可配。
$newposts_type = class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::get_value('nav_user_newposts_btn', 'post')
$newposts_type = class_exists('\Jio\Settings\Settings')
? \Jio\Settings\Settings::get_value('nav_user_newposts_btn', 'post')
: 'post';
if (!empty($newposts_type)) {
$newposts_text = class_exists('\AKSRT\Settings\Settings')
? (string) \AKSRT\Settings\Settings::get_value('nav_user_newposts_btn_text', __('发布内容', 'aksrt'))
: __('发布内容', 'aksrt');
$newposts_text = class_exists('\Jio\Settings\Settings')
? (string) \Jio\Settings\Settings::get_value('nav_user_newposts_btn_text', __('发布内容', 'jio'))
: __('发布内容', 'jio');
$pub_url = (string) $ctx['publish_url'];
$href .= '<a rel="nofollow" href="' . esc_url($pub_url) . '">';
$href .= '<div class="badg mb6 toggle-radius c-green"><i class="fa fas fa-edit" aria-hidden="true"></i></div>';
@@ -214,25 +214,25 @@ if (!function_exists('aksrt_header_user_box_html')) :
$href .= '<a href="javascript:;" data-toggle="modal" data-target="#modal_signout">';
$href .= '<div class="badg mb6 toggle-radius c-red"><i class="fa fas fa-sign-out-alt" aria-hidden="true"></i></div>';
$href .= '<div class="c-red">' . esc_html__('退出登录', 'aksrt') . '</div></a>';
$href .= '<div class="c-red">' . esc_html__('退出登录', 'jio') . '</div></a>';
$href .= '</div>';
if (is_super_admin()) {
$href .= '<div class="flex jsa header-user-href">';
$href .= '<a rel="nofollow" target="_blank" href="' . esc_url((string) $ctx['theme_settings_url']) . '">';
$href .= '<div class="badg mb6 toggle-radius c-yellow"><i class="fa fas fa-sliders-h" aria-hidden="true"></i></div>';
$href .= '<div class="c-yellow">' . esc_html__('主题设置', 'aksrt') . '</div></a>';
$href .= '<div class="c-yellow">' . esc_html__('主题设置', 'jio') . '</div></a>';
// legacy: 模块布局 → widgets.
$href .= '<a rel="nofollow" target="_blank" href="' . esc_url(admin_url('widgets.php')) . '">';
$href .= '<div class="badg mb6 toggle-radius c-yellow"><i class="fa fas fa-chart-pie" aria-hidden="true"></i></div>';
$href .= '<div class="c-yellow">' . esc_html__('模块布局', 'aksrt') . '</div></a>';
// legacy: 商城中心 → 支付中心(AKSRT 支付中心后台菜单)。
$href .= '<a rel="nofollow" target="_blank" href="' . esc_url(admin_url('admin.php?page=aksrt_pay')) . '">';
$href .= '<div class="c-yellow">' . esc_html__('模块布局', 'jio') . '</div></a>';
// legacy: 商城中心 → 支付中心(Jio 支付中心后台菜单)。
$href .= '<a rel="nofollow" target="_blank" href="' . esc_url(admin_url('admin.php?page=jio_pay')) . '">';
$href .= '<div class="badg mb6 toggle-radius c-yellow"><i class="fa fas fa-credit-card" aria-hidden="true"></i></div>';
$href .= '<div class="c-yellow">' . esc_html__('支付中心', 'aksrt') . '</div></a>';
$href .= '<div class="c-yellow">' . esc_html__('支付中心', 'jio') . '</div></a>';
$href .= '<a rel="nofollow" target="_blank" href="' . esc_url(admin_url()) . '">';
$href .= '<div class="badg mb6 toggle-radius c-yellow"><i class="fa fas fa-cog" aria-hidden="true"></i></div>';
$href .= '<div class="c-yellow">' . esc_html__('后台管理', 'aksrt') . '</div></a>';
$href .= '<div class="c-yellow">' . esc_html__('后台管理', 'jio') . '</div></a>';
$href .= '</div>';
}
@@ -241,7 +241,7 @@ if (!function_exists('aksrt_header_user_box_html')) :
$con .= '<div class="user-right flex flex1 ac jsb ml10">';
$con .= '<div class="flex1" style="max-width: calc(100% - 40px);"><b>'
. '<name class="flex ac flex1">'
. '<a class="display-name text-ellipsis" href="' . esc_url(function_exists('aksrt_get_user_home_url') ? aksrt_get_user_home_url($user_id) : get_author_posts_url($user_id)) . '">' . esc_html($display_name) . '</a>'
. '<a class="display-name text-ellipsis" href="' . esc_url(function_exists('jio_get_user_home_url') ? jio_get_user_home_url($user_id) : get_author_posts_url($user_id)) . '">' . esc_html($display_name) . '</a>'
. $vip_badge . $medal_badge . $certification_badge . $level_badge
. '</name>'
. '</b><div class="px12 muted-2-color text-ellipsis">' . esc_html($desc) . '</div></div>';
@@ -256,26 +256,26 @@ if (!function_exists('aksrt_header_user_box_html')) :
$con .= '<div class="mt10 text-center">' . $href . '</div>';
} else {
$vip_guest = '';
if (class_exists('\AKSRT\Settings\Settings')) {
$vs = \AKSRT\Settings\Settings::get_payment_vip_settings();
if (class_exists('\Jio\Settings\Settings')) {
$vs = \Jio\Settings\Settings::get_payment_vip_settings();
if (!empty($vs['enabled']) && !empty($vs['nav_user_pay_vip'])) {
$vip_guest = '<div><a class="em09 signin-loader but jb-red radius4 payvip-icon btn-block mt10" href="javascript:;">'
. '<i class="fa fas fa-gem" aria-hidden="true"></i> '
. esc_html__('开通会员 尊享会员权益', 'aksrt') . '</a></div>';
. esc_html__('开通会员 尊享会员权益', 'jio') . '</a></div>';
}
}
$href = $vip_guest;
$href .= '<div class="flex jsa header-user-href">';
$href .= '<a href="javascript:;" class="signin-loader"><div class="badg mb6 toggle-radius c-blue"><i class="fa fas fa-sign-in-alt" aria-hidden="true"></i></div><div class="c-blue">'
. esc_html__('登录', 'aksrt') . '</div></a>';
. esc_html__('登录', 'jio') . '</div></a>';
if (get_option('users_can_register')) {
$href .= '<a href="javascript:;" class="signup-loader"><div class="badg mb6 toggle-radius c-green"><i class="fa fas fa-user-plus" aria-hidden="true"></i></div><div class="c-green">'
. esc_html__('注册', 'aksrt') . '</div></a>';
. esc_html__('注册', 'jio') . '</div></a>';
}
// legacy: 找回密码 → 统一登录页 resetpassword 标签(带回跳)。
$reset_url = function_exists('aksrt_get_sign_page_url')
? aksrt_get_sign_page_url('resetpassword', [
$reset_url = function_exists('jio_get_sign_page_url')
? jio_get_sign_page_url('resetpassword', [
'redirect_to' => remove_query_arg(
'redirect_to',
home_url(isset($_SERVER['REQUEST_URI']) ? wp_unslash($_SERVER['REQUEST_URI']) : '/')
@@ -283,21 +283,21 @@ if (!function_exists('aksrt_header_user_box_html')) :
])
: wp_lostpassword_url(home_url('/'));
$href .= '<a target="_blank" rel="nofollow" href="' . esc_url($reset_url) . '"><div class="badg mb6 toggle-radius c-purple"><i class="fa fas fa-key" aria-hidden="true"></i></div><div class="c-purple">'
. esc_html__('找回密码', 'aksrt') . '</div></a>';
. esc_html__('找回密码', 'jio') . '</div></a>';
$href .= '</div>';
$con = '<div class="text-center">' . $href . '</div>';
if (class_exists('\AKSRT\Auth\OAuth') && method_exists(\AKSRT\Auth\OAuth::get_instance(), 'render_social_buttons')) {
$con .= (string) \AKSRT\Auth\OAuth::get_instance()->render_social_buttons(__('快速登录', 'aksrt'));
if (class_exists('\Jio\Auth\OAuth') && method_exists(\Jio\Auth\OAuth::get_instance(), 'render_social_buttons')) {
$con .= (string) \Jio\Auth\OAuth::get_instance()->render_social_buttons(__('快速登录', 'jio'));
}
}
$html = '<div class="sub-user-box aksrt-header-userbox">' . $con . '</div>';
$html = '<div class="sub-user-box jio-header-userbox">' . $con . '</div>';
return $html;
}
endif;
if (!function_exists('aksrt_menu_button')) :
if (!function_exists('jio_menu_button')) :
/**
* Right cluster: fold, publish/VIP, theme, user, search (legacy).
*
@@ -309,26 +309,26 @@ if (!function_exists('aksrt_menu_button')) :
*
* @param array<string,mixed> $ctx
*/
function aksrt_menu_button(array $ctx): void {
function jio_menu_button(array $ctx): void {
$layout = (string) ($ctx['layout'] ?? '1');
$user_id = (int) ($ctx['user_id'] ?? 0);
$actions = '';
// Publish and membership actions.
if (function_exists('aksrt_render_header_menu_buttons')) {
$actions = aksrt_render_header_menu_buttons();
if (function_exists('jio_render_header_menu_buttons')) {
$actions = jio_render_header_menu_buttons();
}
// Theme toggle.
$utility_buttons = '';
if (in_array('pc_nav', (array) ($ctx['theme_positions'] ?? []), true)) {
$utility_buttons .= '<a href="javascript:;" class="toggle-theme toggle-radius" id="theme-toggle-desktop" title="'
. esc_attr__('切换亮暗色', 'aksrt') . '">';
. esc_attr__('切换亮暗色', 'jio') . '">';
$utility_buttons .= '<i class="fa far fa-toggle-theme" aria-hidden="true"></i>';
$utility_buttons .= '</a>';
}
if (function_exists('aksrt_get_translate_language_btn')) {
$utility_buttons .= aksrt_get_translate_language_btn('ml10 pull-right');
if (function_exists('jio_get_translate_language_btn')) {
$utility_buttons .= jio_get_translate_language_btn('ml10 pull-right');
}
// Notifications, user and search.
@@ -338,29 +338,29 @@ if (!function_exists('aksrt_menu_button')) :
if ($user_id > 0 && $messages_url !== '' && in_array('nav_menu', $positions, true)) {
$unread = (int) ($ctx['unread_count'] ?? 0);
$notification_but = '<li class="relative"><a rel="nofollow" href="' . esc_url($messages_url)
. '" class="aksrt-nav-icon aksrt-nav-notification" aria-label="' . esc_attr__('消息中心', 'aksrt') . '">'
. '" class="jio-nav-icon jio-nav-notification" aria-label="' . esc_attr__('消息中心', 'jio') . '">'
. '<i class="fa fas fa-bell" aria-hidden="true"></i>';
if ($unread > 0) {
$notification_but .= '<span class="aksrt-notification-badge">' . esc_html((string) min(99, $unread)) . '</span>';
$notification_but .= '<span class="jio-notification-badge">' . esc_html((string) min(99, $unread)) . '</span>';
}
$notification_but .= '</a></li>';
}
$sign_but = '';
$user_sub = '<div class="padding-10">' . aksrt_header_user_box_html($ctx) . '</div>';
$user_sub = '<div class="padding-10">' . jio_header_user_box_html($ctx) . '</div>';
if ('2' === $layout) {
if ($user_id > 0) {
$avatar = aksrt_get_avatar_html($user_id, 36, ['class' => 'avatar']);
$avatar = jio_get_avatar_html($user_id, 36, ['class' => 'avatar']);
$sign_but = '<li><a href="javascript:;" class="navbar-avatar">' . $avatar . '</a><ul class="sub-menu">'
. $user_sub . '</ul></li>';
} else {
$sign_but = '<li><a href="javascript:;" class="signin-loader">' . esc_html__('登录', 'aksrt') . '</a></li>';
$sign_but = '<li><a href="javascript:;" class="signin-loader">' . esc_html__('登录', 'jio') . '</a></li>';
if (get_option('users_can_register')) {
$sign_but .= '<li><a href="javascript:;" class="signup-loader">' . esc_html__('注册', 'aksrt') . '</a></li>';
$sign_but .= '<li><a href="javascript:;" class="signup-loader">' . esc_html__('注册', 'jio') . '</a></li>';
}
}
} else {
$cls = 'aksrt-nav-icon' . ($user_id > 0 ? '' : ' signin-loader');
$cls = 'jio-nav-icon' . ($user_id > 0 ? '' : ' signin-loader');
$sign_but = '<li><a href="javascript:;" class="' . esc_attr($cls) . '">'
. '<svg class="icon" viewBox="50 0 924 924" aria-hidden="true"><use xlink:href="#icon-user"></use></svg></a>'
. '<ul class="sub-menu">' . $user_sub . '</ul></li>';
@@ -368,8 +368,8 @@ if (!function_exists('aksrt_menu_button')) :
$search_but = '';
if ('2' !== $layout) {
$search_but = '<li class="relative"><a href="javascript:;" class="aksrt-nav-icon nav-search-btn main-search-btn" aria-label="'
. esc_attr__('打开搜索', 'aksrt') . '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-search"></use></svg></a></li>';
$search_but = '<li class="relative"><a href="javascript:;" class="jio-nav-icon nav-search-btn main-search-btn" aria-label="'
. esc_attr__('打开搜索', 'jio') . '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-search"></use></svg></a></li>';
}
// Match the reference's adjacent inline items; text whitespace adds a gap
@@ -391,7 +391,7 @@ if (!function_exists('aksrt_menu_button')) :
$fold = '<div class="navbar-form navbar-right hide show-nav-but" style="margin-right:-10px;">'
. '<a data-toggle-class data-target=".nav.navbar-nav" href="javascript:;" class="but" aria-label="'
. esc_attr__('展开菜单', 'aksrt') . '"><svg class="icon" viewBox="0 0 1024 1024" aria-hidden="true"><use xlink:href="#icon-menu_2"></use></svg></a></div>';
. esc_attr__('展开菜单', 'jio') . '"><svg class="icon" viewBox="0 0 1024 1024" aria-hidden="true"><use xlink:href="#icon-menu_2"></use></svg></a></div>';
$html = $fold . ('3' === $layout ? $right_but . $button : $button . $right_but);
@@ -2,25 +2,25 @@
/**
* Header shell orchestration (legacy contract).
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_get_header_nav_context')) :
if (!function_exists('jio_get_header_nav_context')) :
/**
* Shared header render context (settings + brand + user flags).
*
* @return array<string,mixed>
*/
function aksrt_get_header_nav_context(): array {
function jio_get_header_nav_context(): array {
static $ctx = null;
if ($ctx !== null) {
return $ctx;
}
$settings = class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::read_domain('page_display', 'header-nav')
$settings = class_exists('\Jio\Settings\Settings')
? \Jio\Settings\Settings::read_domain('page_display', 'header-nav')
: [];
$layout = sanitize_key((string) ($settings['header_layout'] ?? '1'));
if (!in_array($layout, ['1', '2', '3'], true)) {
@@ -37,39 +37,39 @@ if (!function_exists('aksrt_get_header_nav_context')) :
$nav_fixed = !isset($settings['nav_fixed']) || !empty($settings['nav_fixed']);
$site_name = get_bloginfo('name');
$brand_name = function_exists('aksrt_get_site_logo_text') ? aksrt_get_site_logo_text() : $site_name;
$brand_name = function_exists('jio_get_site_logo_text') ? jio_get_site_logo_text() : $site_name;
$brand_name = $brand_name !== '' ? $brand_name : $site_name;
$logo_url = function_exists('aksrt_get_site_logo_url') ? trim((string) aksrt_get_site_logo_url()) : '';
$logo_dark = function_exists('aksrt_get_site_logo_dark_url') ? trim((string) aksrt_get_site_logo_dark_url()) : '';
$logo_width = function_exists('aksrt_get_site_logo_width') ? aksrt_get_site_logo_width() : 150;
$logo_url = function_exists('jio_get_site_logo_url') ? trim((string) jio_get_site_logo_url()) : '';
$logo_dark = function_exists('jio_get_site_logo_dark_url') ? trim((string) jio_get_site_logo_dark_url()) : '';
$logo_width = function_exists('jio_get_site_logo_width') ? jio_get_site_logo_width() : 150;
$logo_more = $logo_width > 0
? 'style="height:36px;width:auto;max-width:' . max(36, (int) $logo_width) . 'px"'
: 'style="height:36px;width:auto"';
$logo_html = '';
if ($logo_url !== '' || $logo_dark !== '') {
$logo_html = function_exists('aksrt_get_adaptive_theme_img')
? aksrt_get_adaptive_theme_img($logo_url, $logo_dark, $brand_name, $logo_more)
$logo_html = function_exists('jio_get_adaptive_theme_img')
? jio_get_adaptive_theme_img($logo_url, $logo_dark, $brand_name, $logo_more)
: '';
}
$theme_positions = class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::get_theme_mode_button_positions()
$theme_positions = class_exists('\Jio\Settings\Settings')
? \Jio\Settings\Settings::get_theme_mode_button_positions()
: ['pc_nav', 'm_menu'];
$can_publish = (!isset($settings['nav_newposts']) || !empty($settings['nav_newposts'])) && (
current_user_can('manage_options')
|| (class_exists('\AKSRT\Core\FrontSubmit') && \AKSRT\Core\FrontSubmit::get_instance()->can_submit())
|| (class_exists('\Jio\Core\FrontSubmit') && \Jio\Core\FrontSubmit::get_instance()->can_submit())
);
$show_slide = function_exists('aksrt_header_slide_is_show')
? aksrt_header_slide_is_show()
$show_slide = function_exists('jio_header_slide_is_show')
? jio_header_slide_is_show()
: false;
$current_user = wp_get_current_user();
$user_id = (int) $current_user->ID;
$user_desc = $user_id > 0 && function_exists('aksrt_get_user_description') ? aksrt_get_user_description($user_id) : '';
$notification_settings = class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::notification_settings()
$user_desc = $user_id > 0 && function_exists('jio_get_user_description') ? jio_get_user_description($user_id) : '';
$notification_settings = class_exists('\Jio\Settings\Settings')
? \Jio\Settings\Settings::notification_settings()
: ['enabled' => false, 'icon_show' => []];
$ctx = [
@@ -87,30 +87,30 @@ if (!function_exists('aksrt_get_header_nav_context')) :
'current_user' => $current_user,
'user_id' => $user_id,
'user_desc' => $user_desc,
'unread_count' => ($user_id > 0 && function_exists('aksrt_get_user_unread_notification_count'))
? (int) aksrt_get_user_unread_notification_count($user_id)
'unread_count' => ($user_id > 0 && function_exists('jio_get_user_unread_notification_count'))
? (int) jio_get_user_unread_notification_count($user_id)
: 0,
'message_icon_positions' => (array) ($notification_settings['icon_show'] ?? []),
'messages_url' => !empty($notification_settings['enabled']) && function_exists('aksrt_get_messages_page_url') ? aksrt_get_messages_page_url() : '',
'orders_url' => function_exists('aksrt_get_user_center_tab_url') ? aksrt_get_user_center_tab_url('orders') : '',
'publish_url' => function_exists('aksrt_get_new_post_url') ? aksrt_get_new_post_url() : admin_url('post-new.php'),
'theme_settings_url' => function_exists('aksrt_get_admin_settings_url')
? aksrt_get_admin_settings_url('')
: admin_url('admin.php?page=aksrt-settings'),
'search_state' => function_exists('aksrt_get_search_form_state')
? aksrt_get_search_form_state()
'messages_url' => !empty($notification_settings['enabled']) && function_exists('jio_get_messages_page_url') ? jio_get_messages_page_url() : '',
'orders_url' => function_exists('jio_get_user_center_tab_url') ? jio_get_user_center_tab_url('orders') : '',
'publish_url' => function_exists('jio_get_new_post_url') ? jio_get_new_post_url() : admin_url('post-new.php'),
'theme_settings_url' => function_exists('jio_get_admin_settings_url')
? jio_get_admin_settings_url('')
: admin_url('admin.php?page=jio-settings'),
'search_state' => function_exists('jio_get_search_form_state')
? jio_get_search_form_state()
: [
'type' => 'post',
'types' => ['post' => __('文章', 'aksrt')],
'types' => ['post' => __('文章', 'jio')],
'category_id' => 0,
'category_enabled' => false,
'categories' => [],
],
'search_placeholder' => function_exists('aksrt_get_search_placeholder')
? aksrt_get_search_placeholder()
: __('开启精彩搜索', 'aksrt'),
'search_hot_keywords' => function_exists('aksrt_get_search_hot_keywords')
? aksrt_get_search_hot_keywords()
'search_placeholder' => function_exists('jio_get_search_placeholder')
? jio_get_search_placeholder()
: __('开启精彩搜索', 'jio'),
'search_hot_keywords' => function_exists('jio_get_search_hot_keywords')
? jio_get_search_hot_keywords()
: [],
];
@@ -122,12 +122,12 @@ if (!function_exists('aksrt_get_header_nav_context')) :
}
endif;
if (!function_exists('aksrt_header')) :
if (!function_exists('jio_header')) :
/**
* Render top header + mobile drawer (+ optional slide after caller).
*/
function aksrt_header(): void {
$ctx = aksrt_get_header_nav_context();
function jio_header(): void {
$ctx = jio_get_header_nav_context();
$layout = $ctx['layout'];
$header_class = [
'header',
@@ -150,31 +150,31 @@ if (!function_exists('aksrt_header')) :
echo '<nav class="' . esc_attr(implode(' ', array_map('sanitize_html_class', $nav_class))) . '">';
echo '<div class="container-fluid container-header">';
aksrt_navbar_header($ctx);
jio_navbar_header($ctx);
echo '<div class="collapse navbar-collapse">';
if ('3' !== $layout) {
aksrt_menu_items('primary', true);
jio_menu_items('primary', true);
}
if ('2' === $layout) {
aksrt_get_menu_search($ctx);
jio_get_menu_search($ctx);
}
aksrt_menu_button($ctx);
jio_menu_button($ctx);
if ('3' === $layout) {
echo '<div class="navbar-right">';
aksrt_menu_items('primary', true);
jio_menu_items('primary', true);
echo '</div>';
}
echo '</div></div></nav></header>';
aksrt_nav_mobile_shell($ctx);
jio_nav_mobile_shell($ctx);
if (!empty($ctx['show_slide']) && function_exists('aksrt_header_slide')) {
aksrt_header_slide();
if (!empty($ctx['show_slide']) && function_exists('jio_header_slide')) {
jio_header_slide();
}
if (function_exists('aksrt_render_signout_modal')) {
aksrt_render_signout_modal();
if (function_exists('jio_render_signout_modal')) {
jio_render_signout_modal();
}
}
endif;