Zibll 主线收口:统一 single 并清退 compat 资源路径

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-09 20:30:49 +08:00
co-authored by Claude
parent 0a6f97af21
commit 09f1eec909
26 changed files with 158 additions and 1325 deletions
-14
View File
@@ -469,20 +469,6 @@ add_filter('template_include', function ($template) {
return $candidate ?: $template;
});
// 标记为资源的 post:单页改用 single-aksrt_resource.php 模板
add_filter('single_template', function ($template) {
if (!is_singular('post')) return $template;
$post = get_queried_object();
if (!($post instanceof WP_Post)) return $template;
if (!function_exists('aksrt_is_resource_post')) return $template;
if (!aksrt_is_resource_post($post)) return $template;
if (function_exists('aksrt_is_downloadable_content') && !aksrt_is_downloadable_content($post)) {
return $template;
}
$candidate = locate_template(['single-aksrt_resource.php']);
return $candidate ?: $template;
});
// 资源归档页:标题
add_filter('document_title_parts', function ($parts) {
if (get_query_var('aksrt_is_resource_archive')) {