Another issue was found on my website’s requests page. The category filter shows only 3 categories out of 16 (these also have subcategories). I tried cleaning the cache, deactivating cache on logged-in users, so on, and so forth…nothing worked.
I found 2 temporary solutions for this:
/*Displays all request categories and subcategories*/
add_filter(
'hivepress/v1/forms/request_filter',
function ( $form_args ) {
if ( isset( $form_args['fields']['_category'] ) ) {
$form_args['fields']['_category']['options'] = 'terms';
$form_args['fields']['_category']['option_args'] = [ 'taxonomy' => 'hp_request_category' ];
}
return $form_args;
},
1000
);
The 2nd solution displays all 16 categories, but when I select one category and filter the requests, it doesn’t display the subcategories in the filter as the native filter does. Any ideas/ solutions to fix this behaviour?
Thank you for the details.
Could you please provide more info about the issue? Are there any other fields included in the filter form? Have you tried disabling all customizations (if any) to see if the issue still persists? Also, could you please let us know how the filter form works with your listings? Are all the categories displayed correctly?
There is no limit on displaying categories for requests, and on our side, the filter form shows all available categories. If there is a bug, we need all the steps to reproduce it so that we can fix it.
All requests posted on that page are generated through a custom add-on I made for HivePress Requests — I disabled it to check if the issue persists, and it does. Besides the category filter, I have also the map from Geolocation, the search bar with keywords, and Geolocation, and that’s all on that page. It looks quite awkward to me also, and I have no idea what the cause is. For the listing part, I still have to insert the subcategories (and there are a lot of them). After I manage to insert them, I’ll come back to you with an answer. Without the code above, I have three perfectly working categories
If nothing resolves it, please send temporary WP access to support@hivepress.io with the link to this topic, and we’ll check it (please send only the link, without login and password). You can create a temporary access link using this plugin.