Skip to content

Commit

Permalink
fix: don't apply class to non-curate query block
Browse files Browse the repository at this point in the history
  • Loading branch information
psorensen committed Feb 16, 2024
1 parent 1ac8f6a commit 2ff6209
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions assets/js/admin/no-posts-selected.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ const withNoPostsClass = createHigherOrderComponent((BlockListBlock) => {
return <BlockListBlock {...props} />;
}
const { query } = attributes;
const { include = [] } = query;
const { include } = query;
const cn = classnames(className, {
'has-no-posts': include.length < 1,
'has-no-posts': include && include.length < 1,
});
return <BlockListBlock {...props} className={cn} />;
};
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Curated Query Loop
* Description: Adds a post-picker to the Query Loop block.
* Version: 0.1.0
* Version: 0.1.1
* Author: Peter Sorensen, 10up
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: query loop, block
Requires at least: 6.3
Tested up to: 6.4
Requires PHP: 7.4
Stable tag: 0.1.0
Stable tag: 0.1.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down

0 comments on commit 2ff6209

Please sign in to comment.