Skip to content

Commit bfe8990

Browse files
committed
Skip the "what's new" widget if there are no posts to display
1 parent 11debd2 commit bfe8990

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

views/page-widgets/whats-new.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99
exit;
1010
}
1111

12-
$prpl_widget = \progress_planner()->get_admin__widgets__whats_new();
12+
$prpl_widget = \progress_planner()->get_admin__widgets__whats_new();
13+
$prpl_blog_posts = $prpl_widget->get_blog_feed();
14+
15+
// If there are no blog posts, don't display the widget.
16+
if ( empty( $prpl_blog_posts ) ) {
17+
return;
18+
}
1319

1420
?>
1521
<h2 class="prpl-widget-title">

0 commit comments

Comments
 (0)