Skip to content

Commit

Permalink
Display a message if number of posts on subquery block is set to 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
mogmarsh committed Dec 17, 2024
1 parent 970151d commit 6ce0de9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `WP Curate` will be documented in this file.

## 2.4.7 - 2024-12-17

- Enhancement: Display a message if number of posts on subquery block is set to 0.

## 2.4.6 - 2024-12-11

- Bug Fix: Roll back to React 18.
Expand Down
6 changes: 5 additions & 1 deletion blocks/subquery/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,11 @@ export default function Edit({
index === 0 ? (
<>
<div {...blockProps}>
<InnerBlocks template={TEMPLATE} />
{numberOfPosts > 0 ? (
<InnerBlocks template={TEMPLATE} />
) : (
<p style={{ fontStyle: 'italic', fontSize: '80%' }}>Subquery Block: 0 posts selected</p>
)}
</div>
<QueryControls
allowedPostTypes={allowedPostTypes}
Expand Down
2 changes: 1 addition & 1 deletion wp-curate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WP Curate
* Plugin URI: https://github.com/alleyinteractive/wp-curate
* Description: Plugin to curate homepages and other landing pages
* Version: 2.4.6
* Version: 2.4.7
* Author: Alley Interactive
* Author URI: https://github.com/alleyinteractive/wp-curate
* Requires at least: 6.4
Expand Down

0 comments on commit 6ce0de9

Please sign in to comment.