feat(navigation): hard-switch to Zibll navigation and Font Awesome 5

This commit is contained in:
kate522 committed 2026-08-18 20:46:21 +08:00
1 parent 3c3ddac8be
commit a0b84977a2
630 files changed
+101647 -11293

No files matched your search

+7 -2
View File
@@ -223,7 +223,8 @@ add_action('init', function () {
add_filter('query_vars', function ($vars) {
$vars[] = 'aksrt_is_resource_archive';
$vars[] = 'aksrt_legacy_resource';
$vars[] = 'aksrt_search_type';
$vars[] = 'type';
$vars[] = 'trem';
return $vars;
});
@@ -331,7 +332,11 @@ add_action('pre_get_posts', function ($query) {
// 站内搜索:分类/标签名搜索(内容类型始终为 post)
if ($query->is_search() && empty($query->get('post_type'))) {
$search_type = sanitize_key((string) $query->get('aksrt_search_type'));
$search_type = sanitize_key((string) $query->get('type'));
$trem = absint($query->get('trem'));
if ($trem > 0) {
$query->set('cat', $trem);
}
if (in_array($search_type, ['category', 'tag'], true)) {
$taxonomy = $search_type === 'category' ? 'category' : 'post_tag';
+10 -5
View File
@@ -47,7 +47,12 @@ add_filter('manage_post_posts_columns', function ($columns) {
add_action('admin_enqueue_scripts', function ($hook) {
if ($hook !== 'edit.php') return;
wp_enqueue_style('font-awesome-5', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css', [], '5.15.4');
wp_enqueue_style(
'aksrt-font-awesome',
get_template_directory_uri() . '/assets/vendor/fontawesome5/css/all.min.css',
[],
'5.15.4'
);
});
add_action('manage_post_posts_custom_column', function ($column, $post_id) {
@@ -65,12 +70,12 @@ add_action('manage_post_posts_custom_column', function ($column, $post_id) {
};
$parts = [];
$parts[] = '<span title="' . esc_attr__('浏览', 'aksrt') . '" style="margin-right:4px;"><i class="fas fa-eye" style="color:#8a909c;font-size:12px;"></i> ' . esc_html($format($views)) . '</span>';
$parts[] = '<span title="' . esc_attr__('点赞', 'aksrt') . '" style="margin-right:4px;"><i class="fas fa-thumbs-up" style="color:#1890ff;font-size:12px;"></i> ' . esc_html($format($likes)) . '</span>';
$parts[] = '<span title="' . esc_attr__('收藏', 'aksrt') . '" style="margin-right:4px;"><i class="fas fa-star" style="color:#f39c12;font-size:12px;"></i> ' . esc_html($format($favorites)) . '</span>';
$parts[] = '<span title="' . esc_attr__('浏览', 'aksrt') . '" style="margin-right:4px;"><i class="fa fas fa-eye" style="color:#8a909c;font-size:12px;"></i> ' . esc_html($format($views)) . '</span>';
$parts[] = '<span title="' . esc_attr__('点赞', 'aksrt') . '" style="margin-right:4px;"><i class="fa fas fa-thumbs-up" style="color:#1890ff;font-size:12px;"></i> ' . esc_html($format($likes)) . '</span>';
$parts[] = '<span title="' . esc_attr__('收藏', 'aksrt') . '" style="margin-right:4px;"><i class="fa fas fa-star" style="color:#f39c12;font-size:12px;"></i> ' . esc_html($format($favorites)) . '</span>';
if ($downloads > 0) {
$parts[] = '<span title="' . esc_attr__('下载', 'aksrt') . '"><i class="fas fa-download" style="color:#52c41a;font-size:12px;"></i> ' . esc_html($format($downloads)) . '</span>';
$parts[] = '<span title="' . esc_attr__('下载', 'aksrt') . '"><i class="fa fas fa-download" style="color:#52c41a;font-size:12px;"></i> ' . esc_html($format($downloads)) . '</span>';
}
echo implode(' &middot; ', $parts);