Opened 14 years ago
Closed 10 years ago
#16792 closed enhancement (fixed)
CategoryWalker, if cat_name is empty, do not append the empty a tag to the output
Reported by: | samo9789 | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | trivial | Version: | 3.1 |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | Cc: |
Description
If the theme is customized to skip some categories by doing something like add_filter('list_cats', 'hideSomeCatgory') and returning a null or an empty string as cat name, the CategoryWalker will append an empty html element to the output
Attachments (1)
Change History (7)
#5
@
10 years ago
- Keywords needs-refresh removed
- Milestone changed from Awaiting Review to 4.2
samo9789 - Thanks for the patch, and sorry for the delay in response.
In general, I would not recommend the use of the 'list_cats' filter for this purpose - if you want to prevent terms from being displayed in, say, wp_list_categories()
, you're much better off passing an 'exclude' parameter to that function, or filtering 'get_terms'. That being said, I think you're right that there's no good reason to generate an empty element.
Note: See
TracTickets for help on using
tickets.
Hi,
This is my first contribution to an existing open source project. I hope I respected the ticket creation and patch submission process and that this can help improve Wordpress. I hope someone will review this correction.
Take care,
samo9789