Files
kate522andClaude Opus 5 35bb96e82f 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>
2026-11-01 20:05:04 +08:00

97 lines
3.0 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Reusable Page Header Template Part.
*
* Contract: get_template_part(..., null, $args)
*
* Args:
* style – '' | '1' | '2' | '3' | 'not'
* eyebrow – eyebrow label text
* title – title HTML (caller escapes)
* desc – description text
* cover – cover image URL override
* extra – extra HTML (caller escapes)
*
* @package Jio
*/
defined('ABSPATH') || exit;
$args = is_array($args ?? null) ? $args : [];
// Resolve style: explicit args > global setting.
$ph_style = array_key_exists('style', $args) ? $args['style'] : null;
if ($ph_style === null) {
$ph_style = class_exists('\Jio\Settings\Settings')
? (\Jio\Settings\Settings::get_other_page_settings()['header_style'] ?? '1')
: '1';
}
if ($ph_style === 'not') {
$ph_style = '';
}
// '' means "don't show header"
if ($ph_style === '') {
return;
}
$ph_eyebrow = (string) ($args['eyebrow'] ?? '');
$ph_title = (string) ($args['title'] ?? '');
$ph_desc = (string) ($args['desc'] ?? '');
$ph_extra = (string) ($args['extra'] ?? '');
// Cover image: explicit args > global setting > post thumbnail.
$ph_cover = (string) ($args['cover'] ?? '');
if ($ph_cover === '' && class_exists('\Jio\Settings\Settings')) {
$other = \Jio\Settings\Settings::get_other_page_settings();
$ph_cover = (string) ($other['header_cover_img'] ?? '');
}
if ($ph_cover === '' && has_post_thumbnail()) {
$ph_cover = (string) get_the_post_thumbnail_url(get_the_ID(), 'full');
}
// Map style value to CSS modifier class.
$style_class = 'term-page-header--simple';
if ($ph_style === '2') {
$style_class = 'term-page-header--card';
} elseif ($ph_style === '3') {
$style_class = 'term-page-header--cover';
}
// Cover inline style (for cover style).
$cover_style = '';
if ($ph_style === '3' && $ph_cover !== '') {
$cover_style = ' style="background-image:url(\'' . esc_url($ph_cover) . '\')"';
}
?>
<header class="page-header term-page-header <?php echo esc_attr($style_class); ?>">
<?php if ($ph_style === '3' && $ph_cover !== '') : ?>
<div class="term-page-header__cover-bg"<?php echo $cover_style; /* phpcs:ignore -- escaped above */ ?>>
<div class="term-page-header__cover-overlay"></div>
</div>
<?php endif; ?>
<div class="term-page-header__body<?php echo $ph_style === '3' ? ' term-page-header__body--overlay' : ''; ?>">
<div>
<?php if ($ph_eyebrow !== '') : ?>
<p class="term-page-header__eyebrow"><?php echo esc_html($ph_eyebrow); ?></p>
<?php endif; ?>
<h1 class="entry-title"><?php echo $ph_title; /* phpcs:ignore -- caller must escape */ ?></h1>
<?php if ($ph_desc !== '') : ?>
<p class="term-page-header__desc"><?php echo esc_html($ph_desc); ?></p>
<?php endif; ?>
</div>
<?php if ($ph_extra !== '') : ?>
<?php echo $ph_extra; /* phpcs:ignore -- caller must escape */ ?>
<?php endif; ?>
</div>
<?php if ($ph_style === '2' && $ph_cover !== '') : ?>
<div class="term-page-header__cover"<?php echo $cover_style; /* phpcs:ignore -- escaped above */ ?>></div>
<?php endif; ?>
</header>