How to require category selection on Community Events Submission Form?

Home Forums Calendar Products Community Events How to require category selection on Community Events Submission Form?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1188207
    Diana Upton-Hill
    Participant

    Hello,

    we are trying to force Event Category selection on the Events Submission Form.

    This is the code we are using:

    add_filter( 'tribe_events_community_required_fields', 'my_community_required_fields', 10, 1 );
    
    function my_community_required_fields( $fields ) {
    
        if ( ! is_array( $fields ) ) {
            return $fields;
        }
    
        $fields[] = 'post_content';
    	$fields[] = 'EventStartDate';
    	$fields[] = 'venue';
    	$fields[] = 'organizer';
    	$fields[] = 'tribe_events_cat'; //this is one is not working
    
        return $fields;
    }

    Tested with all sort of variations regarding the slug for category, but with no success. Any help?

    Thank you.

    #1188475
    Hunter
    Moderator

    Justin,

    Welcome to our forums 🙂

    Please check out our Required Fields for Events Submission Form Knowledgebase article and let me know if you’re able to get things working as desired.

    Cheers!

    #1188832
    Diana Upton-Hill
    Participant

    Hello Hunter,

    Thank you for your reply. I have visited that link before and that didn’t help me find the correct answer. This is why I have posted the question here.

    As you can see in my sample code above, I have read that thread before and made some other fields required as it is described in documentation.

    But how can we force visitors to select any of the “EVENT CATEGORIES”? That is the problem here:

    $fields[] = 'tribe_events_cat'; //this one is not working

    Thank you.

    #1189424
    Hunter
    Moderator

    Justin,

    We’re fairly limited on how much support we can provide, but I found this recent thread which relates to what you’re trying to accomplish. Try changing the line to:

    $fields[] = 'tax_input';

    I did so on my local test environment and got the desired behavior. With that said, you’ll have to handle things from here and best of luck. Cheers!

    #1199784
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How to require category selection on Community Events Submission Form?’ is closed to new replies.