Hi there,
I now with a snippet I can activate multiple categories on the back-end, but the snippet does not work for the front-end. How can I activate that as well?
And I have already found the thread but it only solves the backend for me.
Ah I think this solves it.
How can I use this for vendors as well?
This seems to work, but when I select a 2nd category it does not take it and updates the field but returns the previous single selection. Also going from a subcategory to a parent category deletes the previous selection.
I only have this problem on the front-end.
I managed by adding
unset( $form[‘fields’][‘categories’][‘attributes’][‘data-multistep’] );
to the snippet:
add_filter(
'hivepress/v1/forms/listing_submit',
function( $form ) {
if(isset($form['fields']['categories'])){
$form['fields']['categories']['multiple'] = true;
unset( $form['fields']['categories']['attributes']['data-multistep'] );
}
return $form;
},
1000
);
So question is only how I can add this for vendors as well.
Hi,
Please use this PHP snippet for backend:
add_filter(
'hivepress/v1/meta_boxes/vendor_attributes',
function( $form ) {
if(isset($form['fields']['categories'])){
$form['fields']['categories']['multiple'] = true;
}
return $form;
},
1000
);