Skip to content

Commit

Permalink
Categories block: display message when no categories found or no post…
Browse files Browse the repository at this point in the history
…s are assigned to categories (#28697)

Co-authored-by: Kyriakos Diamantis <[email protected]>
  • Loading branch information
kirdia and kirdia authored Feb 5, 2021
1 parent b634e7b commit b5c5801
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/block-library/src/categories/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,15 @@ export default function CategoriesEdit( {
<Spinner />
</Placeholder>
) }
{ ! isRequesting && categories.length === 0 && (
<p>
{ __(
'Your site does not have any posts, so there is nothing to display here at the moment.'
) }
</p>
) }
{ ! isRequesting &&
categories.length > 0 &&
( displayAsDropdown
? renderCategoryDropdown()
: renderCategoryList() ) }
Expand Down

0 comments on commit b5c5801

Please sign in to comment.