fix(theme): align reference layouts and restore passing contracts
Align homepage and category discovery, modern widgets, admin controls, quotes, and comments with the reference theme. Remove superseded paths and add rendering and behavior coverage. Update stale asset and finance contracts; all 760 Node tests and 139 widget assertions pass.
This commit is contained in:
1 parent
b520d29368
commit
8aa116ec43
63 files changed
+1985
-2304
No files matched your search
@@ -31,14 +31,22 @@ final class AdminFormController {
|
||||
aksrt_icon_picker_assets(['wp-color-picker']);
|
||||
wp_enqueue_script('aksrt-widget-admin-core', AKSRT_URI . '/assets/widgets/admin-core.js', [], AKSRT_VERSION, true);
|
||||
wp_enqueue_script('aksrt-widget-admin', AKSRT_URI . '/assets/widgets/admin.js', ['jquery', 'jquery-ui-sortable', 'wp-color-picker', 'aksrt-widget-admin-core'], AKSRT_VERSION, true);
|
||||
$sidebars = [];
|
||||
foreach ((array) ($GLOBALS['wp_registered_sidebars'] ?? []) as $id => $sidebar) {
|
||||
$sidebars[(string) $id] = (string) ($sidebar['name'] ?? $id);
|
||||
}
|
||||
wp_localize_script('aksrt-widget-admin', 'aksrtWidgetAdmin', [
|
||||
'ajaxUrl' => admin_url('admin-ajax.php'),
|
||||
'action' => self::AJAX_ACTION,
|
||||
'nonce' => wp_create_nonce(self::NONCE_ACTION),
|
||||
'transferNonce' => wp_create_nonce('aksrt_widgets_transfer'),
|
||||
'sidebars' => $sidebars,
|
||||
'i18n' => [
|
||||
'loading' => __('正在加载模块配置…', 'aksrt'),
|
||||
'error' => __('加载失败,请重试。', 'aksrt'),
|
||||
'export' => __('导出', 'aksrt'),
|
||||
'import' => __('导入', 'aksrt'),
|
||||
'template' => __('应用模板', 'aksrt'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
@@ -60,6 +68,10 @@ final class AdminFormController {
|
||||
$widget->_set($number);
|
||||
$settings = $widget->get_settings();
|
||||
$instance = isset($settings[$number]) && is_array($settings[$number]) ? $settings[$number] : [];
|
||||
$instance = apply_filters('widget_form_callback', $instance, $widget);
|
||||
if (!is_array($instance)) {
|
||||
$instance = [];
|
||||
}
|
||||
ob_start();
|
||||
$widget->render_full_form($instance);
|
||||
$html = (string) ob_get_clean();
|
||||
|
||||
Reference in new issue
Block a user