Skip to content

Commit 44b72cf

Browse files
committed
improve no items handling
1 parent abb26d7 commit 44b72cf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

includes/gutenberg/feedzy-rss-feeds-loop-block.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ public function render_callback( $attributes, $content ) {
158158
}
159159

160160
$feed_items = apply_filters( 'feedzy_get_feed_array', array(), $options, $feed, implode( ',', $feed_urls ), $sizes );
161+
162+
if ( empty( $feed_items ) ) {
163+
return '<div>' . esc_html__( 'No items to display.', 'feedzy-rss-feeds' ) . '</div>';
164+
}
165+
161166
$loop = '';
162167

163168
foreach ($feed_items as $key => $item) {

0 commit comments

Comments
 (0)