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:
1 parent
ea80cd96cc
commit
a579a5b00a
14 files changed
+698
-446
No files matched your search
@@ -24,7 +24,6 @@ final class Runtime {
|
||||
(new RestController())->register_routes();
|
||||
});
|
||||
add_action('wp_enqueue_scripts', [AssetManager::class, 'enqueue_active'], 20);
|
||||
add_action('in_widget_form', [self::class, 'render_placement_hint'], 20, 1);
|
||||
|
||||
AdminFormController::register_hooks();
|
||||
TransferController::register_hooks();
|
||||
@@ -48,21 +47,4 @@ final class Runtime {
|
||||
register_widget(new SchemaWidget($definition));
|
||||
}
|
||||
}
|
||||
|
||||
public static function render_placement_hint(\WP_Widget $widget): void {
|
||||
if (!$widget instanceof SchemaWidget) {
|
||||
return;
|
||||
}
|
||||
$definition = $widget->definition();
|
||||
$messages = [
|
||||
'wide' => __('宽版模块:建议放入全宽或主内容区域;放入侧栏时会显示尺寸警告。', 'aksrt'),
|
||||
'sidebar' => __('侧栏模块:建议放入侧栏区域;放入全宽区域时会显示尺寸警告。', 'aksrt'),
|
||||
'any' => __('自适应模块:可放入主内容、全宽或侧栏区域。', 'aksrt'),
|
||||
];
|
||||
printf(
|
||||
'<p class="aksrt-widget-placement-hint" data-widget-size="%1$s"><span class="dashicons dashicons-info-outline" aria-hidden="true"></span>%2$s</p>',
|
||||
esc_attr($definition->size()),
|
||||
esc_html($messages[$definition->size()] ?? $messages['any'])
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user