feat(widgets): rebuild admin widgets page to match reference theme

- Replace transfer modal/admin-post flow with reference-style AJAX
  export/import/template dialogs (admin-transfer.js, TransferController)
- Customizer "移出模块" action, reference lazy form loading with t-notice
- Common fields use reference labels, dependencies, compact/inline rows,
  top/bottom-only extra spacing; form header with description/reminder
- Remove placement hint, template preview and legacy transfer code
- Fix widget audit (current_datetime stub, honor catalog common flags)
  and regenerate stale golden fixtures for posts_toc, quote, posts

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-10-30 14:00:57 +08:00
1 parent ea80cd96cc
commit a579a5b00a
14 files changed
+698 -446

No files matched your search

+4 -5
View File
@@ -41,11 +41,11 @@ final class SchemaWidget extends \WP_Widget {
$this->render_lazy_placeholder();
return;
}
FormRenderer::render($this, $this->definition->fields(), $instance);
FormRenderer::render($this, $this->definition->form_fields(), $instance);
}
public function render_full_form(array $instance): void {
FormRenderer::render($this, $this->definition->fields(), array_merge($this->definition->defaults(), $instance));
FormRenderer::render($this, $this->definition->form_fields(), array_merge($this->definition->defaults(), $instance));
}
public function update($new_instance, $old_instance): array {
@@ -65,11 +65,10 @@ final class SchemaWidget extends \WP_Widget {
private function render_lazy_placeholder(): void {
printf(
'<div class="aksrt-widget-form-lazy" data-id-base="%1$s" data-widget-number="%2$s"><p class="aksrt-widget-form-lazy__status">%3$s</p><button type="button" class="button aksrt-widget-form-lazy__load">%4$s</button></div>',
'<div class="aksrt-widget-form-lazy" data-id-base="%1$s" data-widget-number="%2$s"><div class="aksrt-widget-form-lazy__status"><div class="t-notice t-loading">%3$s</div></div></div>',
esc_attr($this->id_base),
esc_attr((string) $this->number),
esc_html__('配置将在展开或添加模块后加载。', 'aksrt'),
esc_html__('加载配置', 'aksrt')
esc_html__('正在加载模块配置…', 'aksrt')
);
}
}