Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No "hide_empty" setting on Categories block #35489

Closed
DeveloperWil opened this issue Oct 10, 2021 · 2 comments · Fixed by #39426
Closed

No "hide_empty" setting on Categories block #35489

DeveloperWil opened this issue Oct 10, 2021 · 2 comments · Fixed by #39426
Assignees
Labels
[Block] Categories Affects the Categories Block Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@DeveloperWil
Copy link

What problem does this address?

When using the categories block in the block editor, by default it hides categories that have no associated posts (empty categories).
There is no block setting to override this default behaviour.
I want the option for the Categories block to show all categories in WordPress or to hide empty categories.

What is your proposed solution?

Add a "Hide Empty" = true/false setting to the Categories block settings.

@paaljoachim paaljoachim added [Block] Categories Affects the Categories Block [Type] Enhancement A suggestion for improvement. labels Oct 10, 2021
@ntsekouras ntsekouras added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Oct 18, 2021
@pbearne
Copy link
Contributor

pbearne commented Oct 27, 2021

I will look at this

@mauriac
Copy link
Member

mauriac commented Mar 14, 2022

I've just warmed up @pbearne 's PR

@amustaque97 amustaque97 assigned mauriac and unassigned pbearne Apr 14, 2022
amustaque97 pushed a commit that referenced this issue Apr 14, 2022
* Packages[categories-block]: Add new option to show or hide empty categories.

Fixes #35489

* Update fixture for unit tests

* Fix inverted behaviour

When "Show empty categories" is checked empty categories do not show
and vice versa. This post fix that behavious.

* Use tab for indentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Categories Affects the Categories Block Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
5 participants