Created
July 17, 2024 23:59
-
-
Save hivepress/ec55e87227321fcf1b38fdceaa93d47c to your computer and use it in GitHub Desktop.
Allow selecting multiple categories in the back-end listing form #hivepress #listings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( | |
'hivepress/v1/meta_boxes/listing_attributes', | |
function( $meta_box ) { | |
if ( isset( $meta_box['fields']['categories'] ) ) { | |
$meta_box['fields']['categories']['multiple'] = true; | |
unset( $meta_box['fields']['categories']['attributes']['data-multistep'] ); | |
} | |
return $meta_box; | |
}, | |
1000 | |
); |
Yes, please check this topic https://community.hivepress.io/t/create-listing-with-multiple-categories-on-front-end/12384 Please note that allowing multiple categories may break some features (e.g. in Paid Listings) because a single category is assumed per listing in a few extensions, categories are used like distinct listing types.
Amazing thank you. I'm not using paid listings so should be good, but I'll test it out.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an option to also allow multiple categories in the front-end listing/editing form?