- assets/vendor 全量迁移: fontawesome5→assets/fontawesome5, css→assets/css, js→assets/js/runtime(避开 14 个同名自有文件), img 合并去重→assets/img, fonts→assets/fonts; 删除 assets/vendor - libs 五个与 widgets/third-party 字节相同的库不重复入库, loader paths 改指向 - 运行时切换: _win.uri=assets 根, loader baseUrl=/js/runtime, enlighter 注入 路径同步; PHP 7 个引用文件切换并改名 $zibll_*→$runtime_* - 去品牌: Qinver 头注释/品牌 console.log/演示链接清除, 默认文案中性化 - 功能标识符改名: zib__→aksrt__, zib_ajax→aksrt_ajax, window.zib→ window.aksrtLegacy, zibllblock/*→aksrtblock/*, .zib-widget→.aksrt-panel, .zib-slider→.aksrt-slider, zib_menu_options meta 键等 - 自有 CSS 改名: legacy-utilities/compat-vars/footer shell - admin SPA 重建; 契约测试同步(路径/断言/文件更名) - 例外保留: tests/visual 对照环境与 fixtures 前缀(外部 Zibll 产品引用) 验证: php -l 133 个改动文件通过; runtime 86 个 JS node --check 通过; 契约测试 68/70(2 个失败经 stash 对照确认为存量问题)
83 lines
2.7 KiB
PHP
83 lines
2.7 KiB
PHP
<?php
|
|
/**
|
|
* Public user homepage template.
|
|
*
|
|
* Thin shell: resolve user → build context → mount parts.
|
|
* Layout matches legacy author.php: full-width header + tabs (no commerce sidebar).
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
get_header();
|
|
|
|
$author_identifier = (string) get_query_var('aksrt_author_identifier');
|
|
$user = $author_identifier !== '' && function_exists('aksrt_resolve_public_user')
|
|
? aksrt_resolve_public_user($author_identifier)
|
|
: null;
|
|
|
|
if (!$user instanceof WP_User) {
|
|
wp_safe_redirect(home_url('/'));
|
|
exit;
|
|
}
|
|
|
|
if (!function_exists('aksrt_get_user_home_page_context')) {
|
|
require_once AKSRT_DIR . '/inc/helpers/aksrt-user-home.php';
|
|
}
|
|
|
|
$ctx = aksrt_get_user_home_page_context($user);
|
|
extract($ctx, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
|
|
|
|
require_once AKSRT_DIR . '/templates/parts/user-shared-helpers.php';
|
|
?>
|
|
|
|
<?php \AKSRT\WidgetSystem\WidgetAreas::render('author_top_fluid', 'fluid-widget-wrap'); ?>
|
|
|
|
<main id="main-content" class="site-main container content-shell content-shell--stream aksrt-user-home" tabindex="-1">
|
|
<div class="content-wrap">
|
|
<div class="content-layout content-layout--no-sidebar aksrt-user-home__layout">
|
|
<div class="content-layout__primary">
|
|
<?php
|
|
get_template_part('templates/parts/user/author-hero', null, [
|
|
'user' => $user,
|
|
'dashboard' => $dashboard,
|
|
'user_home_settings' => $user_home_settings,
|
|
'is_author_page' => false,
|
|
'tab_counts' => $tab_counts ?? [],
|
|
]);
|
|
?>
|
|
|
|
<div class="dashboard dashboard--public" data-default-tab="<?php echo esc_attr($default_tab); ?>">
|
|
<div class="dashboard-tabs" role="tablist">
|
|
<?php foreach ($enabled_tabs as $tab_key) :
|
|
$tab_class = $tab_key === $active_tab ? 'is-active' : '';
|
|
if (in_array($tab_key, $tabs_pc_hide, true)) {
|
|
$tab_class .= ' tab-hide-pc';
|
|
}
|
|
if (in_array($tab_key, $tabs_mobile_hide, true)) {
|
|
$tab_class .= ' tab-hide-mobile';
|
|
}
|
|
$tab_count = (int) ($tab_counts[$tab_key] ?? 0);
|
|
?>
|
|
<button type="button" class="<?php echo esc_attr(trim($tab_class)); ?>" data-tab="<?php echo esc_attr($tab_key); ?>" role="tab">
|
|
<?php echo esc_html($tab_labels[$tab_key] ?? ucfirst($tab_key)); ?>
|
|
<span class="dashboard-tabs__count opacity8"><?php echo esc_html((string) $tab_count); ?></span>
|
|
</button>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
|
|
<?php
|
|
get_template_part('templates/parts/user-home/panels', 'core', $ctx);
|
|
get_template_part('templates/parts/user-home/panel', 'follow', $ctx);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<?php \AKSRT\WidgetSystem\WidgetAreas::render('author_bottom_fluid', 'fluid-widget-wrap'); ?>
|
|
|
|
<?php get_footer(); ?>
|