diff --git a/assets/css/frontend/widgets/part-2.css b/assets/css/frontend/widgets/part-2.css index 14337910..9cc4840d 100644 --- a/assets/css/frontend/widgets/part-2.css +++ b/assets/css/frontend/widgets/part-2.css @@ -298,3 +298,15 @@ } /* ============================================================ + + +.aksrt-null--widget { + padding: 12px 0 !important; +} +.aksrt-null--widget .aksrt-null__img { + margin: 0 auto; + display: block; +} +.aksrt-null .separator { + border: 0; +} diff --git a/assets/img/null.svg b/assets/img/null.svg new file mode 100644 index 00000000..d6dd55b1 --- /dev/null +++ b/assets/img/null.svg @@ -0,0 +1,9 @@ + diff --git a/inc/bootstrap.php b/inc/bootstrap.php index e5573087..2b383295 100644 --- a/inc/bootstrap.php +++ b/inc/bootstrap.php @@ -43,6 +43,7 @@ require_once AKSRT_DIR . '/inc/helpers/aksrt-resource.php'; require_once AKSRT_DIR . '/inc/helpers/aksrt-pay.php'; require_once AKSRT_DIR . '/inc/helpers/aksrt-coupon-order.php'; require_once AKSRT_DIR . '/inc/helpers/aksrt-credits.php'; +require_once AKSRT_DIR . '/inc/helpers/aksrt-null.php'; require_once AKSRT_DIR . '/inc/helpers/menu-decoration.php'; require_once AKSRT_DIR . '/inc/helpers/class-aksrt-nav-walker.php'; require_once AKSRT_DIR . '/inc/helpers/aksrt-transactions.php'; diff --git a/inc/classes/class-aksrt-widgets-batch1.php b/inc/classes/class-aksrt-widgets-batch1.php index 22e558c8..50e6d6f4 100644 --- a/inc/classes/class-aksrt-widgets-batch1.php +++ b/inc/classes/class-aksrt-widgets-batch1.php @@ -192,7 +192,7 @@ class AKSRT_Recent_Comments_Widget extends WP_Widget { -
+ ' . esc_html__('暂无评论', 'aksrt') . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> - + ' . esc_html__('暂无友情链接', 'aksrt') . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> '; wp_reset_postdata(); } else { - echo ''; + echo function_exists('aksrt_get_widget_null') ? aksrt_get_widget_null(__('暂无热门文章', 'aksrt')) : ''; } echo $args['after_widget']; @@ -360,7 +360,7 @@ class AKSRT_Tab_Posts_Widget extends WP_Widget { - + ' . esc_html__('暂无文章', 'aksrt') . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> diff --git a/inc/classes/widgets/class-aksrt-home-widgets.php b/inc/classes/widgets/class-aksrt-home-widgets.php index aaf55950..78a9e722 100644 --- a/inc/classes/widgets/class-aksrt-home-widgets.php +++ b/inc/classes/widgets/class-aksrt-home-widgets.php @@ -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 ''; + echo function_exists('aksrt_get_widget_null') ? aksrt_get_widget_null(__('暂无内容', 'aksrt')) : ''; wp_reset_postdata(); return; } @@ -464,7 +464,7 @@ class AKSRT_Category_Tabs_Widget extends WP_Widget { echo ''; 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 ''; + echo function_exists('aksrt_get_widget_null') ? aksrt_get_widget_null(__('暂无推荐分类', 'aksrt')) : ''; echo ''; echo $args['after_widget']; return; diff --git a/inc/helpers/aksrt-comments.php b/inc/helpers/aksrt-comments.php index de3de7eb..cb94a64c 100644 --- a/inc/helpers/aksrt-comments.php +++ b/inc/helpers/aksrt-comments.php @@ -571,12 +571,18 @@ if (!function_exists('aksrt_comments_render_empty')) : * @param array' . esc_html__('成为第一个评论者吧', 'aksrt') . '
'; + return; + } ?>