#21856 closed enhancement (fixed)
Hide category selection when no posts are available
Reported by: | CoenJacobs | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Posts, Post Types | Keywords: | ux-feedback has-patch needs-screenshots |
Focuses: | ui, administration | Cc: |
Description
Just an idea that popped up while testing #21015. The months dropdown gets hidden when there are no posts available, so why not hide the category dropdown list too?
Might be a bit confusing though, when certain elements are not showing when you first start using the screens that these elements are used. But showing something that does not do what it looks like is even more confusing, I think.
Attachments (3)
Change History (17)
#3
in reply to:
↑ 2
@
12 years ago
Replying to nofearinc:
Related to this, the get_terms function returns only taxonomy terms with some posts inside unless hide_empty is assigned a true value.
No, not related. This is on the edit.php screen, where there is also a category selection element. This does not hide when there are no posts but shows categories regardless of having posts.
#4
follow-up:
↓ 5
@
12 years ago
Seems like the problem has been taken care of in revision 21806
#5
in reply to:
↑ 4
@
12 years ago
Replying to nofearinc:
Seems like the problem has been taken care of in revision 21806
No, it is not that. Sorry about not being clearer, but I mean the category select box right above the list of posts on the edit.php screen. See attached screenshot.
#6
@
12 years ago
- Keywords has-patch added
I see where you're referring to.
This is my first attempt at a Wordpress patch, so I apologize in advance if any information I have submitted is in the wrong workflow order. Patch added.
#7
@
11 years ago
- Keywords needs-testing added
Revised the patch, made sure the conditional only takes away the category dropdown instead of the whole element including the do_action( 'restrict_manage_posts' );
action.
#8
follow-up:
↓ 10
@
11 years ago
- Focuses ui added
- Keywords ui-feedback removed
In what situation would this actually not show, given that a post more or less has to have a category? If you have no posts at all?
#9
@
11 years ago
- Component changed from Administration to Posts, Post Types
- Focuses administration added
#10
in reply to:
↑ 8
@
11 years ago
Replying to helen:
In what situation would this actually not show, given that a post more or less has to have a category? If you have no posts at all?
Exactly, when there are only auto drafts and no posts that will be shown on that page (but the conditional to show the category selection element will still see the auto drafts).
#11
@
11 years ago
I ensured I had only an auto-draft post (or posts), made sure my All Posts view was saying "No posts found." and tested before and after applying the patch.
Without the patch the "View all categories" dropdown displayed and when I clicked on it and chose "Uncategorized" I still saw the "No posts found." screen.
I applied the patch and the "View all categories" dropdown" no longer displayed and again I still saw the "No posts found." screen.
#12
@
9 years ago
- Keywords needs-testing removed
- Milestone changed from Awaiting Review to 4.4
Patch still applies and works without problems.
On my install I had 4 trashed posts and no other posts. Without the patch categories of trashed posts were shown, with the patch applied the category dropdown is hidden as expected.
I think we should get this into 4.4.
Related to this, the get_terms function returns only taxonomy terms with some posts inside unless hide_empty is assigned a true value.