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
@@ -6,22 +6,22 @@ declare(strict_types=1);
|
||||
namespace {
|
||||
define('ABSPATH', __DIR__ . '/');
|
||||
|
||||
$GLOBALS['aksrt_set_settings'] = [];
|
||||
$GLOBALS['aksrt_set_meta'] = [];
|
||||
$GLOBALS['aksrt_set_json'] = null;
|
||||
$GLOBALS['aksrt_set_output'] = '';
|
||||
$GLOBALS['aksrt_set_term'] = null;
|
||||
$GLOBALS['aksrt_set_post'] = null;
|
||||
$GLOBALS['aksrt_set_queried'] = 0;
|
||||
$GLOBALS['aksrt_set_post_type'] = 'post';
|
||||
$GLOBALS['aksrt_set_is_single'] = false;
|
||||
$GLOBALS['aksrt_set_is_page'] = false;
|
||||
$GLOBALS['aksrt_set_is_category'] = false;
|
||||
$GLOBALS['aksrt_set_object'] = null;
|
||||
$GLOBALS['aksrt_set_page_templates'] = [];
|
||||
$GLOBALS['aksrt_set_can'] = true;
|
||||
$GLOBALS['aksrt_set_scripts'] = [];
|
||||
$GLOBALS['aksrt_set_post_format'] = '';
|
||||
$GLOBALS['jio_set_settings'] = [];
|
||||
$GLOBALS['jio_set_meta'] = [];
|
||||
$GLOBALS['jio_set_json'] = null;
|
||||
$GLOBALS['jio_set_output'] = '';
|
||||
$GLOBALS['jio_set_term'] = null;
|
||||
$GLOBALS['jio_set_post'] = null;
|
||||
$GLOBALS['jio_set_queried'] = 0;
|
||||
$GLOBALS['jio_set_post_type'] = 'post';
|
||||
$GLOBALS['jio_set_is_single'] = false;
|
||||
$GLOBALS['jio_set_is_page'] = false;
|
||||
$GLOBALS['jio_set_is_category'] = false;
|
||||
$GLOBALS['jio_set_object'] = null;
|
||||
$GLOBALS['jio_set_page_templates'] = [];
|
||||
$GLOBALS['jio_set_can'] = true;
|
||||
$GLOBALS['jio_set_scripts'] = [];
|
||||
$GLOBALS['jio_set_post_format'] = '';
|
||||
|
||||
function __(string $text, string $domain = ''): string { return $text; }
|
||||
function esc_html__($t, $d = ''): string { return (string) $t; }
|
||||
@@ -35,22 +35,22 @@ namespace {
|
||||
function wp_unslash($v) { return $v; }
|
||||
function absint($v): int { return max(0, (int) $v); }
|
||||
function is_user_logged_in(): bool { return true; }
|
||||
function current_user_can($cap, ...$args): bool { return (bool) $GLOBALS['aksrt_set_can']; }
|
||||
function is_single(): bool { return $GLOBALS['aksrt_set_is_single']; }
|
||||
function is_page(): bool { return $GLOBALS['aksrt_set_is_page']; }
|
||||
function is_category(): bool { return $GLOBALS['aksrt_set_is_category']; }
|
||||
function current_user_can($cap, ...$args): bool { return (bool) $GLOBALS['jio_set_can']; }
|
||||
function is_single(): bool { return $GLOBALS['jio_set_is_single']; }
|
||||
function is_page(): bool { return $GLOBALS['jio_set_is_page']; }
|
||||
function is_category(): bool { return $GLOBALS['jio_set_is_category']; }
|
||||
function is_tag(): bool { return false; }
|
||||
function is_tax(): bool { return false; }
|
||||
function get_queried_object_id(): int { return $GLOBALS['aksrt_set_queried']; }
|
||||
function get_queried_object() { return $GLOBALS['aksrt_set_object']; }
|
||||
function get_post_type(): string { return $GLOBALS['aksrt_set_post_type']; }
|
||||
function get_post($id) { return $GLOBALS['aksrt_set_post']; }
|
||||
function get_post_meta($id, $key = '', $single = false) { return $GLOBALS['aksrt_set_meta'][$key] ?? ''; }
|
||||
function update_post_meta($id, $key, $value): void { $GLOBALS['aksrt_set_meta'][$key] = $value; }
|
||||
function get_queried_object_id(): int { return $GLOBALS['jio_set_queried']; }
|
||||
function get_queried_object() { return $GLOBALS['jio_set_object']; }
|
||||
function get_post_type(): string { return $GLOBALS['jio_set_post_type']; }
|
||||
function get_post($id) { return $GLOBALS['jio_set_post']; }
|
||||
function get_post_meta($id, $key = '', $single = false) { return $GLOBALS['jio_set_meta'][$key] ?? ''; }
|
||||
function update_post_meta($id, $key, $value): void { $GLOBALS['jio_set_meta'][$key] = $value; }
|
||||
function get_the_title($id): string { return '示例标题'; }
|
||||
function get_the_permalink($id): string { return 'https://example.test/post'; }
|
||||
function get_post_format($id) { return $GLOBALS['aksrt_set_post_format'] ?? ''; }
|
||||
function set_post_format($id, $format): void { $GLOBALS['aksrt_set_meta']['__format'] = $format; }
|
||||
function get_post_format($id) { return $GLOBALS['jio_set_post_format'] ?? ''; }
|
||||
function set_post_format($id, $format): void { $GLOBALS['jio_set_meta']['__format'] = $format; }
|
||||
function post_type_supports($type, $feature): bool { return $feature === 'post-formats'; }
|
||||
function get_theme_support($feature) { return $feature === 'post-formats' ? [['image', 'video']] : false; }
|
||||
function get_post_format_string($format): string { return ucfirst((string) $format); }
|
||||
@@ -59,12 +59,12 @@ namespace {
|
||||
function get_edit_term_link($id, $tax = '') { return 'https://example.test/wp-admin/term.php'; }
|
||||
function get_taxonomy($tax) { return (object) ['labels' => (object) ['singular_name' => '分类']]; }
|
||||
function get_post_type_object($type) { return (object) ['labels' => (object) ['singular_name' => $type === 'page' ? '页面' : '文章']]; }
|
||||
function get_term($id, $tax = '') { return $GLOBALS['aksrt_set_term']; }
|
||||
function wp_update_term($id, $tax, $args) { $GLOBALS['aksrt_set_meta']['__term'] = $args; return 1; }
|
||||
function wp_update_post($args, $wp_error = false) { $GLOBALS['aksrt_set_meta']['__post'] = $args; return 1; }
|
||||
function get_term($id, $tax = '') { return $GLOBALS['jio_set_term']; }
|
||||
function wp_update_term($id, $tax, $args) { $GLOBALS['jio_set_meta']['__term'] = $args; return 1; }
|
||||
function wp_update_post($args, $wp_error = false) { $GLOBALS['jio_set_meta']['__post'] = $args; return 1; }
|
||||
function is_wp_error($v): bool { return false; }
|
||||
function wp_is_mobile(): bool { return false; }
|
||||
function is_page_template($tpl): bool { return in_array($tpl, $GLOBALS['aksrt_set_page_templates'], true); }
|
||||
function is_page_template($tpl): bool { return in_array($tpl, $GLOBALS['jio_set_page_templates'], true); }
|
||||
function home_url($path = ''): string { return 'https://example.test' . $path; }
|
||||
function add_query_arg($args, $url = null) {
|
||||
if ($args === null) { return 'https://example.test/current'; }
|
||||
@@ -80,68 +80,68 @@ namespace {
|
||||
}
|
||||
function check_ajax_referer($action = -1, $name = '_wpnonce'): bool { return true; }
|
||||
function wp_send_json($data, $code = null): void {
|
||||
$GLOBALS['aksrt_set_json'] = $data;
|
||||
$GLOBALS['jio_set_json'] = $data;
|
||||
throw new \RuntimeException('__sent__');
|
||||
}
|
||||
function wp_kses($t, $allowed = null): string { return (string) $t; }
|
||||
function checked($a, $b = true, $echo = true): string { return (string) $a === (string) $b ? ' checked="checked"' : ''; }
|
||||
function selected($a, $b = true, $echo = true): string { return (string) $a === (string) $b ? ' selected="selected"' : ''; }
|
||||
function wp_enqueue_script($handle, $src = '', $deps = [], $ver = false, $in_footer = false): void {
|
||||
$GLOBALS['aksrt_set_scripts'][$handle] = ['src' => $src, 'deps' => $deps, 'in_footer' => $in_footer];
|
||||
$GLOBALS['jio_set_scripts'][$handle] = ['src' => $src, 'deps' => $deps, 'in_footer' => $in_footer];
|
||||
}
|
||||
function get_template_directory(): string { return dirname(__DIR__, 2); }
|
||||
function get_template_directory_uri(): string { return 'https://example.test/wp-content/themes/aksrt-theme'; }
|
||||
function get_template_directory_uri(): string { return 'https://example.test/wp-content/themes/jio-theme'; }
|
||||
|
||||
function set_check(bool $condition, string $message): void {
|
||||
if (!$condition) throw new \RuntimeException($message);
|
||||
}
|
||||
}
|
||||
|
||||
namespace AKSRT\Settings {
|
||||
namespace Jio\Settings {
|
||||
final class ExtensionRuntime {
|
||||
public static array $settings = [];
|
||||
public static function get_system_tools_settings(): array { return self::$settings; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace AKSRT\Core {
|
||||
namespace Jio\Core {
|
||||
final class PostMetaBox {
|
||||
public const META_KEY = 'aksrt_post_extension';
|
||||
public static function get_meta(int $post_id): array { return $GLOBALS['aksrt_set_meta']; }
|
||||
public const META_KEY = 'jio_post_extension';
|
||||
public static function get_meta(int $post_id): array { return $GLOBALS['jio_set_meta']; }
|
||||
}
|
||||
final class DomainModel {
|
||||
public const POST_VIEW_COUNT_KEY = 'aksrt_post_views';
|
||||
public const POST_VIEW_COUNT_KEY = 'jio_post_views';
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
use AKSRT\Frontend\PageAdminSet;
|
||||
use Jio\Frontend\PageAdminSet;
|
||||
|
||||
require dirname(__DIR__, 2) . '/src/Frontend/PageAdminSet.php';
|
||||
|
||||
\AKSRT\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => true];
|
||||
$GLOBALS['aksrt_set_queried'] = 0;
|
||||
$GLOBALS['aksrt_set_is_single'] = true;
|
||||
\Jio\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => true];
|
||||
$GLOBALS['jio_set_queried'] = 0;
|
||||
$GLOBALS['jio_set_is_single'] = true;
|
||||
|
||||
// --- Gate: a non-admin-visible context must not render anything. ---
|
||||
set_check(PageAdminSet::enabled() === false, 'enabled() must be false without a queried object');
|
||||
|
||||
$GLOBALS['aksrt_set_queried'] = 12;
|
||||
$GLOBALS['jio_set_queried'] = 12;
|
||||
set_check(PageAdminSet::enabled() === true, 'enabled() must be true on a single post for an admin');
|
||||
|
||||
$GLOBALS['aksrt_set_can'] = false;
|
||||
$GLOBALS['jio_set_can'] = false;
|
||||
set_check(PageAdminSet::enabled() === false, 'enabled() must respect manage_options');
|
||||
$GLOBALS['aksrt_set_can'] = true;
|
||||
$GLOBALS['jio_set_can'] = true;
|
||||
|
||||
\AKSRT\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => false];
|
||||
\Jio\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => false];
|
||||
set_check(PageAdminSet::enabled() === false, 'enabled() must respect the admin_frontend_set switch');
|
||||
\AKSRT\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => true];
|
||||
\Jio\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => true];
|
||||
|
||||
$GLOBALS['aksrt_set_page_templates'] = ['templates/pages/page-submit.php'];
|
||||
$GLOBALS['jio_set_page_templates'] = ['templates/pages/page-submit.php'];
|
||||
set_check(PageAdminSet::enabled() === false, 'enabled() must exclude the submit page template');
|
||||
$GLOBALS['aksrt_set_page_templates'] = [];
|
||||
$GLOBALS['jio_set_page_templates'] = [];
|
||||
|
||||
$GLOBALS['aksrt_set_post'] = (object) ['ID' => 12, 'post_type' => 'post'];
|
||||
$GLOBALS['jio_set_post'] = (object) ['ID' => 12, 'post_type' => 'post'];
|
||||
|
||||
// --- Modal: reference markup parity. ---
|
||||
ob_start();
|
||||
@@ -154,7 +154,7 @@ namespace {
|
||||
set_check(strpos($modal, 'class="modal-content page-set-modal"') !== false, 'modal must keep the page-set-modal class');
|
||||
set_check(strpos($modal, 'class="modal-dialog" role="document"') !== false, 'modal must keep the reference dialog/document roles');
|
||||
set_check(strpos($modal, 'data-dismiss="modal"') !== false, 'modal header must expose the dismiss button');
|
||||
set_check(strpos($modal, 'name="action" value="aksrt_frontend_set_save"') !== false, 'modal must post aksrt_frontend_set_save');
|
||||
set_check(strpos($modal, 'name="action" value="jio_frontend_set_save"') !== false, 'modal must post jio_frontend_set_save');
|
||||
set_check(strpos($modal, 'name="taxonomy" value=""') !== false, 'modal must post the taxonomy field');
|
||||
set_check(strpos($modal, 'name="post_type" value="post"') !== false, 'modal must post the post_type field');
|
||||
set_check(strpos($modal, 'name="id" value="12"') !== false, 'modal must post the object id');
|
||||
@@ -188,53 +188,53 @@ namespace {
|
||||
set_check($e->getMessage() === '__sent__', 'ajax_save must terminate via wp_send_json');
|
||||
}
|
||||
|
||||
set_check(is_array($GLOBALS['aksrt_set_json']), 'save must send a JSON payload');
|
||||
set_check(($GLOBALS['aksrt_set_json']['msg'] ?? '') === '保存成功,正在刷新页面', 'save must reuse the reference success message');
|
||||
set_check(!empty($GLOBALS['aksrt_set_json']['reload']), 'save must ask the client to reload');
|
||||
set_check(($GLOBALS['aksrt_set_meta']['__post']['post_title'] ?? '') === '新标题', 'save must update the post title');
|
||||
set_check(($GLOBALS['aksrt_set_meta']['__post']['comment_status'] ?? '') === 'closed', 'save must close comments when empty');
|
||||
set_check(is_array($GLOBALS['jio_set_json']), 'save must send a JSON payload');
|
||||
set_check(($GLOBALS['jio_set_json']['msg'] ?? '') === '保存成功,正在刷新页面', 'save must reuse the reference success message');
|
||||
set_check(!empty($GLOBALS['jio_set_json']['reload']), 'save must ask the client to reload');
|
||||
set_check(($GLOBALS['jio_set_meta']['__post']['post_title'] ?? '') === '新标题', 'save must update the post title');
|
||||
set_check(($GLOBALS['jio_set_meta']['__post']['comment_status'] ?? '') === 'closed', 'save must close comments when empty');
|
||||
|
||||
$saved_meta = $GLOBALS['aksrt_set_meta']['aksrt_post_extension'] ?? [];
|
||||
$saved_meta = $GLOBALS['jio_set_meta']['jio_post_extension'] ?? [];
|
||||
set_check(($saved_meta['show_layout'] ?? '') === 'no_sidebar', 'save must persist show_layout');
|
||||
set_check(($saved_meta['subtitle'] ?? '') === '副标题', 'save must persist the subtitle');
|
||||
set_check(!empty($saved_meta['no_article-navs']), 'checked checkbox must persist as on');
|
||||
set_check(empty($saved_meta['article_maxheight_xz']), 'unchecked checkbox must persist as off');
|
||||
set_check((int) $GLOBALS['aksrt_set_meta']['aksrt_post_views'] === 42, 'save must persist the view count');
|
||||
set_check((int) $GLOBALS['aksrt_set_meta']['_aksrt_like_count'] === 7, 'save must persist the like count');
|
||||
set_check((int) $GLOBALS['jio_set_meta']['jio_post_views'] === 42, 'save must persist the view count');
|
||||
set_check((int) $GLOBALS['jio_set_meta']['_jio_like_count'] === 7, 'save must persist the like count');
|
||||
|
||||
// --- Permission: the switch off must reject the save even with a valid object. ---
|
||||
\AKSRT\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => false];
|
||||
$GLOBALS['aksrt_set_json'] = null;
|
||||
\Jio\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => false];
|
||||
$GLOBALS['jio_set_json'] = null;
|
||||
try {
|
||||
(new PageAdminSet())->ajax_save();
|
||||
} catch (\RuntimeException $e) {
|
||||
// expected
|
||||
}
|
||||
set_check(($GLOBALS['aksrt_set_json']['error'] ?? 0) === 1, 'disabled switch must reject the save');
|
||||
set_check(!empty($GLOBALS['aksrt_set_json']['ys']), 'rejection must carry the danger type for the legacy client');
|
||||
set_check(($GLOBALS['jio_set_json']['error'] ?? 0) === 1, 'disabled switch must reject the save');
|
||||
set_check(!empty($GLOBALS['jio_set_json']['ys']), 'rejection must carry the danger type for the legacy client');
|
||||
|
||||
// --- Term save path. ---
|
||||
\AKSRT\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => true];
|
||||
$GLOBALS['aksrt_set_json'] = null;
|
||||
$GLOBALS['aksrt_set_meta'] = [];
|
||||
$GLOBALS['aksrt_set_term'] = (object) ['term_id' => 5, 'taxonomy' => 'category', 'name' => '旧名称', 'description' => ''];
|
||||
\Jio\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => true];
|
||||
$GLOBALS['jio_set_json'] = null;
|
||||
$GLOBALS['jio_set_meta'] = [];
|
||||
$GLOBALS['jio_set_term'] = (object) ['term_id' => 5, 'taxonomy' => 'category', 'name' => '旧名称', 'description' => ''];
|
||||
$_POST = ['id' => '5', 'type' => 'tax', 'taxonomy' => 'category', 'term_name' => '新分类', 'term_description' => '描述'];
|
||||
try {
|
||||
(new PageAdminSet())->ajax_save();
|
||||
} catch (\RuntimeException $e) {
|
||||
// expected
|
||||
}
|
||||
set_check(($GLOBALS['aksrt_set_meta']['__term']['name'] ?? '') === '新分类', 'term save must update the name');
|
||||
set_check(($GLOBALS['aksrt_set_meta']['__term']['description'] ?? '') === '描述', 'term save must update the description');
|
||||
set_check(($GLOBALS['jio_set_meta']['__term']['name'] ?? '') === '新分类', 'term save must update the name');
|
||||
set_check(($GLOBALS['jio_set_meta']['__term']['description'] ?? '') === '描述', 'term save must update the description');
|
||||
|
||||
// --- Page branch: 标题样式 + 模块布局 + 容器位置. ---
|
||||
$GLOBALS['aksrt_set_queried'] = 21;
|
||||
$GLOBALS['aksrt_set_is_single'] = false;
|
||||
$GLOBALS['aksrt_set_is_page'] = true;
|
||||
$GLOBALS['aksrt_set_post_type'] = 'page';
|
||||
$GLOBALS['aksrt_set_post'] = (object) ['ID' => 21, 'post_type' => 'page'];
|
||||
$GLOBALS['aksrt_set_json'] = null;
|
||||
$GLOBALS['aksrt_set_meta'] = [];
|
||||
$GLOBALS['jio_set_queried'] = 21;
|
||||
$GLOBALS['jio_set_is_single'] = false;
|
||||
$GLOBALS['jio_set_is_page'] = true;
|
||||
$GLOBALS['jio_set_post_type'] = 'page';
|
||||
$GLOBALS['jio_set_post'] = (object) ['ID' => 21, 'post_type' => 'page'];
|
||||
$GLOBALS['jio_set_json'] = null;
|
||||
$GLOBALS['jio_set_meta'] = [];
|
||||
$_POST = [
|
||||
'id' => '21',
|
||||
'type' => 'post',
|
||||
@@ -248,41 +248,41 @@ namespace {
|
||||
} catch (\RuntimeException $e) {
|
||||
// expected
|
||||
}
|
||||
set_check(($GLOBALS['aksrt_set_meta']['page_header_style'] ?? '') === '2', 'page save must persist the header style');
|
||||
set_check(($GLOBALS['aksrt_set_meta']['widgets_register'] ?? '') === '1', 'page save must enable the widget container');
|
||||
set_check(($GLOBALS['aksrt_set_meta']['widgets_register_container'] ?? []) === ['sidebar', 'top_fluid'], 'page save must persist container positions');
|
||||
set_check(($GLOBALS['jio_set_meta']['page_header_style'] ?? '') === '2', 'page save must persist the header style');
|
||||
set_check(($GLOBALS['jio_set_meta']['widgets_register'] ?? '') === '1', 'page save must enable the widget container');
|
||||
set_check(($GLOBALS['jio_set_meta']['widgets_register_container'] ?? []) === ['sidebar', 'top_fluid'], 'page save must persist container positions');
|
||||
|
||||
$GLOBALS['aksrt_set_json'] = null;
|
||||
$GLOBALS['aksrt_set_meta'] = [];
|
||||
$GLOBALS['jio_set_json'] = null;
|
||||
$GLOBALS['jio_set_meta'] = [];
|
||||
$_POST = ['id' => '21', 'type' => 'post', 'post_title' => '页面标题', 'widgets_register' => '0'];
|
||||
try {
|
||||
(new PageAdminSet())->ajax_save();
|
||||
} catch (\RuntimeException $e) {
|
||||
// expected
|
||||
}
|
||||
set_check(($GLOBALS['aksrt_set_meta']['widgets_register'] ?? '') === '', 'closing the widget container must clear the flag');
|
||||
set_check(($GLOBALS['aksrt_set_meta']['widgets_register_container'] ?? ['x']) === [], 'closing the widget container must clear positions');
|
||||
set_check(($GLOBALS['jio_set_meta']['widgets_register'] ?? '') === '', 'closing the widget container must clear the flag');
|
||||
set_check(($GLOBALS['jio_set_meta']['widgets_register_container'] ?? ['x']) === [], 'closing the widget container must clear positions');
|
||||
|
||||
// --- Hint script: the transient label must fade like the reference theme. ---
|
||||
PageAdminSet::enqueue_hint_script();
|
||||
$hint = $GLOBALS['aksrt_set_scripts']['aksrt-front-page-admin-set'] ?? null;
|
||||
$hint = $GLOBALS['jio_set_scripts']['jio-front-page-admin-set'] ?? null;
|
||||
set_check(is_array($hint), 'the hint fade script must be enqueued when the feature is on');
|
||||
set_check(strpos((string) ($hint['src'] ?? ''), '/assets/js/front-page-admin-set.js') !== false, 'the hint fade script must point at front-page-admin-set.js');
|
||||
set_check(($hint['deps'] ?? []) === ['jquery'], 'the hint fade script must depend on jQuery');
|
||||
set_check(!empty($hint['in_footer']), 'the hint fade script must load in the footer');
|
||||
|
||||
\AKSRT\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => false];
|
||||
$GLOBALS['aksrt_set_scripts'] = [];
|
||||
\Jio\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => false];
|
||||
$GLOBALS['jio_set_scripts'] = [];
|
||||
PageAdminSet::enqueue_hint_script();
|
||||
set_check($GLOBALS['aksrt_set_scripts'] === [], 'the disabled switch must not enqueue the hint fade script');
|
||||
\AKSRT\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => true];
|
||||
set_check($GLOBALS['jio_set_scripts'] === [], 'the disabled switch must not enqueue the hint fade script');
|
||||
\Jio\Settings\ExtensionRuntime::$settings = ['admin_frontend_set' => true];
|
||||
|
||||
// --- Icons: the site-wide convention is the normalized `fa fas fa-*` form. ---
|
||||
$GLOBALS['aksrt_set_queried'] = 12;
|
||||
$GLOBALS['aksrt_set_is_single'] = true;
|
||||
$GLOBALS['aksrt_set_is_page'] = false;
|
||||
$GLOBALS['aksrt_set_post_type'] = 'post';
|
||||
$GLOBALS['aksrt_set_post'] = (object) ['ID' => 12, 'post_type' => 'post'];
|
||||
$GLOBALS['jio_set_queried'] = 12;
|
||||
$GLOBALS['jio_set_is_single'] = true;
|
||||
$GLOBALS['jio_set_is_page'] = false;
|
||||
$GLOBALS['jio_set_post_type'] = 'post';
|
||||
$GLOBALS['jio_set_post'] = (object) ['ID' => 12, 'post_type' => 'post'];
|
||||
ob_start();
|
||||
(new PageAdminSet())->render_modal();
|
||||
$modal_icons = (string) ob_get_clean();
|
||||
@@ -310,8 +310,8 @@ namespace {
|
||||
set_check(strpos($modal_icons, "value=\"{$extra}\"") === false, "post format options must not leak the theme-only format {$extra}");
|
||||
}
|
||||
// 已设置格式时必须回显选中项。
|
||||
$GLOBALS['aksrt_set_meta']['__format'] = '';
|
||||
$GLOBALS['aksrt_set_post_format'] = 'image';
|
||||
$GLOBALS['jio_set_meta']['__format'] = '';
|
||||
$GLOBALS['jio_set_post_format'] = 'image';
|
||||
ob_start();
|
||||
(new PageAdminSet())->render_modal();
|
||||
$modal_image = (string) ob_get_clean();
|
||||
|
||||
Reference in new issue
Block a user