Opened 9 years ago
Closed 9 years ago
#36152 closed enhancement (fixed)
add bypass filter to remove category dropdown on post table
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 4.4.2 |
Component: | Posts, Post Types | Keywords: | good-first-bug has-patch commit |
Focuses: | administration | Cc: |
Description
Much like #30254. Only with categories there is no function that handles showing the dropdown. This patch adds that function along with the filter to simply bypass showing the dropdown and prevent any additional SQL or code to run. This is useful for situations where you disable the categories column in the post/list table, but do not wish to remove the use of categories.
Attachments (3)
Change History (14)
#1
@
9 years ago
- Keywords needs-patch good-first-bug added
- Milestone changed from Awaiting Review to Future Release
#2
@
9 years ago
I have added a patch. I figured categories are bound to posts and the function should be in the WP_Posts_List_Table class and not in the WP_List_Table class.
#4
@
9 years ago
The new categories_dropdown()
method needs some docs love as per https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/, but otherwise it looks good.
#5
@
9 years ago
- Owner set to davidmosterd
- Status changed from new to assigned
Marking the "good-first-bug" as claimed
#6
@
9 years ago
Thanks for pointing that out. Hope I did the comments better now. If not, can you please help me out what to improve?
#7
@
9 years ago
- Milestone changed from Future Release to 4.6
- Owner changed from davidmosterd to swissspidy
- Status changed from assigned to reviewing
Thanks for the updated patch and sorry for my late reply!
I'll update the version numbers and perhaps slightly change the wording to be more similar to the one in WP_List_Table::months_dropdown()
. After that it's good to go in my opinion!
#8
@
9 years ago
@swissspidy While you're at it can you add an @access
tag to the method and make the check against the filter more strict? I'm not a huge fan of the semi-truthy or semi-falsey kinds of boolean filters, better to be explicit.
#9
@
9 years ago
In 36152.3.diff:
- Change the version number to 4.6.0
- Add the
@access
tag - Make filter more explicit
- Adjust wording
Good to go in my opinion.
First patch