Skip to content

Commit

Permalink
improve no items handling
Browse files Browse the repository at this point in the history
  • Loading branch information
HardeepAsrani committed Jan 6, 2025
1 parent abb26d7 commit 44b72cf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes/gutenberg/feedzy-rss-feeds-loop-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ public function render_callback( $attributes, $content ) {
}

$feed_items = apply_filters( 'feedzy_get_feed_array', array(), $options, $feed, implode( ',', $feed_urls ), $sizes );

if ( empty( $feed_items ) ) {
return '<div>' . esc_html__( 'No items to display.', 'feedzy-rss-feeds' ) . '</div>';
}

$loop = '';

foreach ($feed_items as $key => $item) {
Expand Down

0 comments on commit 44b72cf

Please sign in to comment.