diff --git a/assets/admin/src/constants/admin-sections.js b/assets/admin/src/constants/admin-sections.js index d4a8d1a4..ceaffb35 100644 --- a/assets/admin/src/constants/admin-sections.js +++ b/assets/admin/src/constants/admin-sections.js @@ -6,5 +6,5 @@ * the navigation tree and router definitions while keeping each file focused. */ -export { ADMIN_SECTIONS, getAllAdminPages } from './sections/index.js' +export { ADMIN_SECTIONS, getAdminSections, getAllAdminPages } from './sections/index.js' export { renderFaIcon, customPage, schemaPage, deferredPage } from './sections/helpers.js' diff --git a/inc/bootstrap.php b/inc/bootstrap.php index dcc6dbb5..945ee557 100644 --- a/inc/bootstrap.php +++ b/inc/bootstrap.php @@ -32,6 +32,7 @@ require_once AKSRT_DIR . '/inc/helpers/aksrt-vip.php'; require_once AKSRT_DIR . '/inc/helpers/aksrt-i18n-switch.php'; require_once AKSRT_DIR . '/inc/helpers/aksrt-posts-renderer.php'; require_once AKSRT_DIR . '/inc/helpers/aksrt-resource.php'; +require_once AKSRT_DIR . '/inc/helpers/aksrt-compat.php'; require_once AKSRT_DIR . '/inc/helpers/aksrt-pay.php'; require_once AKSRT_DIR . '/inc/helpers/aksrt-credits.php'; require_once AKSRT_DIR . '/inc/helpers/menu-decoration.php'; diff --git a/inc/classes/class-aksrt-templates.php b/inc/classes/class-aksrt-templates.php index 685bee29..b79765dc 100644 --- a/inc/classes/class-aksrt-templates.php +++ b/inc/classes/class-aksrt-templates.php @@ -32,7 +32,10 @@ class AKSRT_Templates { // 短代码注册统一在 AKSRT_Shortcodes(registry);本类只提供 archive/profile 渲染实现。 } - private function page_template_map(): array { + /** + * 主线页面模板:内容 / 用户 / 付费 / 论坛 / 商城主线可选模板。 + */ + private function mainline_page_template_map(): array { return [ 'templates/pages/page-sign.php' => __('AKSRT - 登录/注册', 'aksrt'), 'templates/pages/page-profile.php' => __('AKSRT - 个人中心', 'aksrt'), @@ -41,12 +44,7 @@ class AKSRT_Templates { 'templates/pages/page-categories.php' => __('AKSRT - 分类汇总', 'aksrt'), 'templates/pages/page-newposts.php' => __('AKSRT - 最新文章', 'aksrt'), 'templates/pages/page-posts-navs.php' => __('AKSRT - 文章导航', 'aksrt'), - 'templates/pages/page-special.php' => __('AKSRT - 专题聚合', 'aksrt'), - 'templates/pages/page-documentnav.php' => __('AKSRT - 文档导航', 'aksrt'), 'templates/pages/page-friends.php' => __('AKSRT - 友情链接', 'aksrt'), - 'templates/pages/page-messages.php' => __('AKSRT - 消息中心', 'aksrt'), - 'templates/pages/page-download.php' => __('AKSRT - 下载中心', 'aksrt'), - 'templates/pages/page-submit.php' => __('AKSRT - 前台投稿', 'aksrt'), 'templates/pages/page-orders.php' => __('AKSRT - 订单中心', 'aksrt'), 'templates/pages/page-revenue.php' => __('AKSRT - 收益中心', 'aksrt'), 'templates/pages/page-cart.php' => __('AKSRT - 购物车', 'aksrt'), @@ -57,6 +55,34 @@ class AKSRT_Templates { ]; } + /** + * 兼容保留页面模板:非 Zibll 主线能力(文档模式、下载中心、专题、消息、投稿)。 + * + * 这些模板文件与已分配它们的历史页面继续正常渲染(见 load_page_template()), + * 只是默认不再出现在 wp-admin 页面模板下拉中,避免污染主线内容心智。 + * 站点可通过 aksrt_show_compat_page_templates() 重新暴露下拉选项。 + */ + private function compat_page_template_map(): array { + return [ + 'templates/pages/page-special.php' => __('AKSRT - 专题聚合(兼容)', 'aksrt'), + 'templates/pages/page-documentnav.php' => __('AKSRT - 文档导航(兼容)', 'aksrt'), + 'templates/pages/page-messages.php' => __('AKSRT - 消息中心(兼容)', 'aksrt'), + 'templates/pages/page-download.php' => __('AKSRT - 下载中心(兼容)', 'aksrt'), + 'templates/pages/page-submit.php' => __('AKSRT - 前台投稿(兼容)', 'aksrt'), + ]; + } + + private function page_template_map(): array { + $map = $this->mainline_page_template_map(); + + // 兼容页面模板默认隐藏出下拉;仅在站点显式开启时暴露。 + if (function_exists('aksrt_show_compat_page_templates') && aksrt_show_compat_page_templates()) { + $map = array_merge($map, $this->compat_page_template_map()); + } + + return $map; + } + /** * Register selectable page templates in wp-admin. */ diff --git a/inc/helpers/aksrt-compat.php b/inc/helpers/aksrt-compat.php new file mode 100644 index 00000000..2588d707 --- /dev/null +++ b/inc/helpers/aksrt-compat.php @@ -0,0 +1,98 @@ + - - - - + + + + + + +