Opened 16 years ago
Closed 12 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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.2 |
| Component: | Taxonomy | Version: | 3.1 |
| Severity: | trivial | Keywords: | has-patch |
| Cc: | Focuses: |
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
@
12 years ago
- Keywords needs-refresh removed
- Milestone Awaiting Review → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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