diff --git a/src/Admin/Native/PayChargeCards.php b/src/Admin/Native/PayChargeCards.php index fe392193..05b9e97e 100644 --- a/src/Admin/Native/PayChargeCards.php +++ b/src/Admin/Native/PayChargeCards.php @@ -855,12 +855,16 @@ class PayChargeCards { */ private function submessage_row(array $deps, string $content): void { $dep_attr = ' data-dep="' . esc_attr((string) wp_json_encode($deps)) . '"'; - $hidden = $this->deps_visible($deps) ? '' : 'display:none;'; - // data-dep 与初始隐藏状态必须同时挂在 和内层提示块上,不能只依赖行: - // 提示块一旦脱离所在行(表格上下文里出现不被允许的节点时,HTML 解析器会把它 - // foster-parent 到 之前),只有 带状态会让四条提示永久铺开、 - // 且切换卡密类型/添加方式时求值结果无处落地。自带状态后两种结构都成立。 - echo ''; // phpcs:ignore WordPress.Security.EscapeOutput -- 文案已转义。 + $hidden = $this->deps_visible($deps) ? '' : ' style="display:none;"'; + // 提示块**不要**挂 WP 的 .notice / .notice-warning:wp-admin/js/common.js 在 DOM + // 就绪时会执行 + // $('div.updated, div.error, div.notice').not('.inline, .below-h2').insertAfter($headerEnd) + // 把页面上所有「非 inline」的 notice 整块搬到 .wp-header-end(不存在时取 .wrap 内首个 + // h1/h2)之后。提示块一旦带上 notice,就会被搬到页面顶部、脱离「添加方式—卡密数据」 + // 之间的字段区,而且搬迁发生在求值之后,行内的显隐逻辑无从纠正。 + // 外观改由 .aksrt-submsg 自带(见 print_assets),与参考主题 CSF content 字段一致。 + // data-dep 与初始隐藏状态同时挂在 和内层提示块上:提示块若脱离所在行,仍能自行显隐。 + echo ''; // phpcs:ignore WordPress.Security.EscapeOutput -- 文案已转义。 } /** @@ -1053,6 +1057,9 @@ class PayChargeCards { .aksrt-btnset-item input { position: absolute; opacity: 0; pointer-events: none; } .aksrt-btnset-item span { display: inline-block; padding: 3px 12px; border: 1px solid #c3c4c7; border-radius: 3px; background: #fff; } .aksrt-btnset-item input:checked + span { background: #2271b1; border-color: #2271b1; color: #fff; } + /* 导入提示:复刻后台 notice-warning 的外观,但**不用** .notice 类 —— 见 submessage_row() + 的说明,带 .notice 会被 wp-admin/js/common.js 搬到页面顶部。改这里请连带改那里。 */ + .aksrt-submsg { margin: 6px 0; padding: 6px 12px; background: #fef8ee; border-left: 4px solid #f0b849; } .aksrt-copy-tip { margin-left: 6px; color: #00a32a; font-size: 12px; white-space: nowrap; }
' . $content . '
' . $content . '