Add multiple categories select to add listing form

I have two questions.

I am trying to find a solution to let the user select how the image is cropped. Is there a solution for this, I have been trying to use Croppie, but can’t figure out how to get it to work in the listing_submit form. I can understand how to add filters to add and modify fields. But ideally it would trigger when when the user tried to upload the image. This implementation is a little complex for me. Any guidance to get me started would be appreciated. I would also be happy to make my own template for the user listing form, and implement it that way, is there any documentation on how to do that?

I want to make it so the user can select categories with a checkbox so multiple categories can be selected in listing_submit . I tried like this but it didn’t work :frowning:

add_filter(
    'hivepress/v1/forms/listing_submit',
    function( $form ) {
        // Check if the Categories field exists in the form
        if ( isset( $form['fields']['categories'] ) ) {
            // Change the field type to 'checkboxes'
            $form['fields']['categories']['type'] = 'checkboxes';

            $categories = get_terms( array(
                'taxonomy'   => 'hp_listing_category',
                'hide_empty' => false,
            ) );

            if ( ! is_wp_error( $categories ) ) {
                $options = [];

                foreach ( $categories as $category ) {
                    $options[ $category->term_id ] = $category->name;
                }

                $form['fields']['categories']['options'] = $options;
            }
        }

        return $form;
    }
);

Hi,

  1. Unfortunately, there is no simple solution, it will require a detailed review and custom integration.

  2. Yes, according to the category design, this is a type of listing, and they are distinct. We recommend trying custom multiple select attributes if you have any other listing characteristics. As for categories, leave them for unusual things.

​I hope this is helpful to you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.