对小工具进行了一些修复

This commit is contained in:
2026-08-26 11:17:22 +08:00
parent 523af723ae
commit 9ad6f41592
9 changed files with 17 additions and 223 deletions
@@ -260,29 +260,6 @@ final class GeneralRenderer {
}
wp_reset_postdata();
}
} elseif ($source === 'forums' && function_exists('zib_bbs_get_posts_query') && (!function_exists('_pz') || _pz('bbs_s'))) {
$query_args = (array) ($i['forums_opts'] ?? []);
$query_args['plate'] = $query_args['plate'] ?? 0;
$query_args['paged_size'] = (int) ($i['count'] ?? 8);
$query_args['paged'] = 1;
$query_args['no_found_rows'] = true;
$posts_query = zib_bbs_get_posts_query($query_args);
$lists = [];
if ($posts_query && method_exists($posts_query, 'have_posts')) {
while ($posts_query->have_posts()) {
$posts_query->the_post();
$post_id = get_the_ID();
$subtitle = class_exists('AKSRT\\Core\\PostMetaBox') ? \AKSRT\Core\PostMetaBox::get_meta_value($post_id, 'subtitle', '') : '';
$title = trim(wp_strip_all_tags(get_the_title())) . trim(wp_strip_all_tags((string) $subtitle));
if (!empty($i['desc_s'])) {
$description = class_exists('AKSRT\\Core\\PostMetaBox') ? \AKSRT\Core\PostMetaBox::get_meta_value($post_id, 'description', '') : '';
if (trim((string) $description) === '') $description = get_the_excerpt();
$title .= ': ' . wp_html_excerpt(wp_strip_all_tags((string) $description), 160, '...');
}
$lists[] = ['title' => $title, 'href' => get_permalink()];
}
wp_reset_postdata();
}
}
$msg_icon = ($posts_query && !empty($i['msg_icon'])) ? self::notice_icon((string) $i['msg_icon']) : '';
$slides = '';