Forums › Forums › Search & Filter Pro › Custom Taxonomy: Items not in dropdown if Hide Empty checked
Tagged: hide emtpy, search form, taxonomy
- This topic has 9 replies, 2 voices, and was last updated 5 years, 5 months ago by Anonymous.
-
Anonymous(Private) May 12, 2019 at 7:35 pm #210873
I have a custom taxonomy on attachments only and am filtering my search on a Custom Taxonomy and 2 CPT custom fields. My filters include:
1. Search form (default is blank)
2. Taxonomy: attachment_category (hide empty not checked)
3. CPT Field: document-year (hide empty checked)
4. CPT Field: document_language (hide empty checked)When I bring up the search form all 15 values in #2 show up in the dropdown with correct counts, and the CPT Fields behave as expected when I apply filters. However, if i set the Hide Empty flag on the Taxonomy, the dropdown only shows 2 values. Am I doing something wrong, or am I missing something. The problem with leaving the Hide Empty unchecked on the Taxonomy is that when I filter on one of the CPT fields, all the values still show in the Taxonomy, but with (0) count if no items of that taxonomy apply to the filtered CPT field(s). CPT fields work as expected. Am I missing something, or it this a bug?
Anonymous(Private) May 15, 2019 at 12:11 pm #211260No, it is not. If Hide empty is not checked, the category drop-down shows 15 categories all with count > 0. When I check Hide Empty, the category drop-down shows only 2 categories with counts, even though the results show entries for all categories (including the ones not showing in the dropdown) . Is there a way to send a screen shot? if now, here are 2 links – one with hide empty checked and one with hide empty not checked.
https://dev.haiti-now.org/resource-search-hide-empty-checked/
https://dev.haiti-now.org/resource-search-hide-empty-not-checked/Anonymous(Private) May 15, 2019 at 3:18 pm #211305Thank you so much for your help. I found my problem – and it was not with the plugin. It was the method I used to bulk load the taxonomy tables in WordPress. I wrote custom sql to upload all the attachment categories and tags, but I neglected to update the count in the term_taxonomy table after I got them uploaded. Even though the counts displayed properly in the Attachment Category screen in the media admin section, your plugin must look at that count to determine wether it is empty. Once I updated the counts, both the original attachment_tag taxonomy and the new resource_category taxonomy worked as expected.
-
AuthorPosts