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:
1 parent
b1731f7a8d
commit
a0748c08fe
10 files changed
+140
-9
No files matched your search
@@ -192,7 +192,7 @@ class AKSRT_Recent_Comments_Widget extends WP_Widget {
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<p class="widget-empty"><?php esc_html_e('暂无评论', 'aksrt'); ?></p>
|
||||
<?php echo function_exists('aksrt_get_widget_null') ? aksrt_get_widget_null(__('暂无评论', 'aksrt')) : '<p class="widget-empty">' . esc_html__('暂无评论', 'aksrt') . '</p>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php endif;
|
||||
|
||||
echo $args['after_widget'];
|
||||
@@ -263,7 +263,7 @@ class AKSRT_Friend_Links_Widget extends WP_Widget {
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<p class="widget-empty"><?php esc_html_e('暂无友情链接', 'aksrt'); ?></p>
|
||||
<?php echo function_exists('aksrt_get_widget_null') ? aksrt_get_widget_null(__('暂无友情链接', 'aksrt')) : '<p class="widget-empty">' . esc_html__('暂无友情链接', 'aksrt') . '</p>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php endif;
|
||||
|
||||
echo $args['after_widget'];
|
||||
|
||||
@@ -107,7 +107,7 @@ class AKSRT_Hot_Posts_Widget extends WP_Widget {
|
||||
echo '</div>';
|
||||
wp_reset_postdata();
|
||||
} else {
|
||||
echo '<p class="widget-empty">' . esc_html__('暂无热门文章', 'aksrt') . '</p>';
|
||||
echo function_exists('aksrt_get_widget_null') ? aksrt_get_widget_null(__('暂无热门文章', 'aksrt')) : '<p class="widget-empty">' . esc_html__('暂无热门文章', 'aksrt') . '</p>';
|
||||
}
|
||||
|
||||
echo $args['after_widget'];
|
||||
@@ -360,7 +360,7 @@ class AKSRT_Tab_Posts_Widget extends WP_Widget {
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<p class="widget-empty"><?php esc_html_e('暂无文章', 'aksrt'); ?></p>
|
||||
<?php echo function_exists('aksrt_get_widget_null') ? aksrt_get_widget_null(__('暂无文章', 'aksrt')) : '<p class="widget-empty">' . esc_html__('暂无文章', 'aksrt') . '</p>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php wp_reset_postdata(); $first = false; endforeach; ?>
|
||||
|
||||
@@ -189,7 +189,7 @@ if (!function_exists('aksrt_home_widget_render_post_grid')) {
|
||||
*/
|
||||
function aksrt_home_widget_render_post_grid(WP_Query $query, string $layout = 'card', int $columns = 3, string $context = 'homepage'): void {
|
||||
if (!$query->have_posts()) {
|
||||
echo '<p class="widget-empty">' . esc_html__('暂无内容', 'aksrt') . '</p>';
|
||||
echo function_exists('aksrt_get_widget_null') ? aksrt_get_widget_null(__('暂无内容', 'aksrt')) : '<p class="widget-empty">' . esc_html__('暂无内容', 'aksrt') . '</p>';
|
||||
wp_reset_postdata();
|
||||
return;
|
||||
}
|
||||
@@ -464,7 +464,7 @@ class AKSRT_Category_Tabs_Widget extends WP_Widget {
|
||||
echo '<section class="aksrt-home-widget aksrt-home-widget--tabs widget-tab-posts">';
|
||||
|
||||
if (empty($tabs)) {
|
||||
echo '<p class="widget-empty">' . esc_html__('暂无可用分类', 'aksrt') . '</p>';
|
||||
echo function_exists('aksrt_get_widget_null') ? aksrt_get_widget_null(__('暂无可用分类', 'aksrt')) : '<p class="widget-empty">' . esc_html__('暂无可用分类', 'aksrt') . '</p>';
|
||||
echo '</section>';
|
||||
echo $args['after_widget'];
|
||||
return;
|
||||
@@ -649,7 +649,7 @@ class AKSRT_Category_Recommend_Widget extends WP_Widget {
|
||||
aksrt_home_widget_render_header($title);
|
||||
|
||||
if (empty($cards)) {
|
||||
echo '<p class="widget-empty">' . esc_html__('暂无推荐分类', 'aksrt') . '</p>';
|
||||
echo function_exists('aksrt_get_widget_null') ? aksrt_get_widget_null(__('暂无推荐分类', 'aksrt')) : '<p class="widget-empty">' . esc_html__('暂无推荐分类', 'aksrt') . '</p>';
|
||||
echo '</section>';
|
||||
echo $args['after_widget'];
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user