Zibll 主线收口:统一 single 并清退 compat 资源路径
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user