feat(frontend): illustrated null states and author rewards fallback

Add aksrt_get_null / widget null helpers with null.svg, use them in
sidebar widgets, comments empty, and related posts; when PM is off show
post rewards entry on the single author bar.
This commit is contained in:
kate522 committed 2026-07-16 19:33:57 +08:00
1 parent b1731f7a8d
commit a0748c08fe
10 files changed
+140 -9

No files matched your search

+7 -1
View File
@@ -571,12 +571,18 @@ if (!function_exists('aksrt_comments_render_empty')) :
* @param array<string,mixed> $ctx Comments context.
*/
function aksrt_comments_render_empty(array $ctx): void {
$text = (string) ($ctx['empty_text'] ?? __('暂无评论内容', 'aksrt'));
if (function_exists('aksrt_get_null')) {
echo aksrt_get_null($text, 40, 'null.svg', 'comment comment-null comments-empty', 220); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '<p class="comments-empty__hint muted-3-color em09 text-center" style="margin-top:-20px;">' . esc_html__('成为第一个评论者吧', 'aksrt') . '</p>';
return;
}
?>
<div class="comments-empty post_ajax_loader">
<div class="comments-empty__icon">
<i class="far fa-comment-dots"></i>
</div>
<p class="comments-empty__text"><?php echo esc_html((string) $ctx['empty_text']); ?></p>
<p class="comments-empty__text"><?php echo esc_html($text); ?></p>
<p class="comments-empty__hint"><?php esc_html_e('成为第一个评论者吧', 'aksrt'); ?></p>
</div>
<?php