兼容层收口:隔离非主线入口

将文档模式、下载中心、专题聚合、消息中心、前台投稿等非 Zibll 主线能力
收敛为“兼容保留”,默认不再作为主入口暴露,但保留路由/模板/数据/设置键。

- 新增 inc/helpers/aksrt-compat.php 兼容策略中枢:
  - aksrt_get_messages_url()(补齐此前缺失、被两处模板调用的 helper)
  - aksrt_pm_frontend_enabled()(前台私信入口开关,默认关闭)
  - aksrt_show_compat_page_templates()(兼容页面模板下拉开关,默认关闭)
- AKSRT_Templates::page_template_map() 拆分为主线/兼容两组,兼容模板默认
  移出 wp-admin 页面模板下拉;已分配这些模板的历史页面照常渲染。
- 作者操作条“私信”按钮(停用候选)默认前台隐藏,可经 filter/常量开启。
- 修复 admin-sections.js barrel 未再导出 getAdminSections 的缺陷,该缺陷
  会使 router 的兼容分区默认落点重定向在加载时抛错。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-07-06 15:22:34 +08:00
1 parent 5402768f23
commit 8afb4ec856
5 files changed
+139 -11

No files matched your search

+7 -4
View File
@@ -62,10 +62,13 @@ $classes = trim('article-avatar ' . $extra_class . ($show_actions ? ' article-av
<i class="far fa-heart" aria-hidden="true"></i>
<span><?php esc_html_e('关注', 'aksrt'); ?></span>
</button>
<a href="<?php echo esc_url(add_query_arg('msg_type', 'conversation', function_exists('aksrt_get_messages_url') ? aksrt_get_messages_url() : home_url('/messages/'))); ?>" class="author-action-btn author-action-btn--ghost">
<i class="far fa-comment-dots" aria-hidden="true"></i>
<span><?php esc_html_e('私信', 'aksrt'); ?></span>
</a>
<?php // 私信为“停用候选”兼容能力:默认不在前台暴露,仅在站点显式开启时显示。 ?>
<?php if (function_exists('aksrt_pm_frontend_enabled') && aksrt_pm_frontend_enabled()) : ?>
<a href="<?php echo esc_url(add_query_arg('msg_type', 'conversation', aksrt_get_messages_url())); ?>" class="author-action-btn author-action-btn--ghost">
<i class="far fa-comment-dots" aria-hidden="true"></i>
<span><?php esc_html_e('私信', 'aksrt'); ?></span>
</a>
<?php endif; ?>
<?php elseif (!is_user_logged_in()) : ?>
<a href="<?php echo esc_url(function_exists('aksrt_get_login_url') ? aksrt_get_login_url() : wp_login_url(get_permalink())); ?>" class="author-action-btn author-action-btn--follow">
<i class="far fa-heart" aria-hidden="true"></i>