';
echo '
';
if ($plate) {
$plate_name = (string) jio_get_setting('jio_forum_plate_name', '版块') ?: '版块';
echo '';
} elseif ($term instanceof \WP_Term) {
echo '';
}
}
private static function close(string $context): void {
echo '
';
self::sidebar($context);
echo '';
$panes .= $index === $active
? self::pane($tab, $plate, $term, $index)
: '
';
}
return '';
}
/** @return array' . HomeTabs::placeholder('posts', 3) . '
';
$panes .= '' . HomeTabs::placeholder('posts', 3) . '
';
if ($html !== '' && trim(wp_strip_all_tags($html)) !== '') return $html;
$empty = jio_get_ajax_null('内容空空如也');
if ($index === 1 && $page === 1 && $plate instanceof \WP_Post) {
$empty .= '';
}
return $empty;
}
/** @return int[] */
private static function topping(int $plate_id, array $tab): array {
if (($tab['filter'] ?? '') === 'essence' || ($tab['status'] ?? '') !== '') return [];
return wp_list_pluck(self::topping_posts($plate_id, $tab), 'ID');
}
/** @return \WP_Post[] */
private static function topping_posts(int $plate_id, array $tab): array {
return get_posts([
'post_type' => Core::POST,
'post_status' => 'publish',
'posts_per_page' => 5,
'meta_query' => [
['key' => '_jio_forum_plate_id', 'value' => $plate_id],
['key' => '_jio_forum_pinned', 'value' => 1],
],
]);
}
}