Form code for required fields not working

Home Forums Calendar Products Community Events Form code for required fields not working

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1155600
    matt
    Participant

    Hello,

    Since updating to the latest versions of your plugins, the code in my functions.php file don’t seem to be working to make the email and phone fields required under organiser details. I’m not sure what I have done wrong.
    Here is the link to the form…

    http://blueseptember.org.nz/events/community/add/

    Kind regards,
    Matt

    #1155756
    Nico
    Member

    Hi there Matt,

    Thanks for getting in touch! Indeed we introduced a fix in Community Events for the old validation code because it broke at some point, this was reported by other users and developers decided to do this in a different way although the knowledgebase article isn’t reflecting these changes yet (but will be updated soon).

    Try using this code instead (be sure to modify it to match your required fields):

    /* Tribe make community fields require */
    add_filter( 'tribe_events_community_required_fields', 'my_community_required_fields', 10, 1 );
    function my_community_required_fields( $fields ) {
    $fields = array(
    'post_title',
    'post_content',
    'venue',
    //'organizer',
    );

    return $fields;
    }

    add_filter( 'tribe_events_community_required_venue_fields', 'my_venue_community_required_fields', 10, 1 );
    function my_venue_community_required_fields( $fields ) {
    $fields = array(
    'Venue', //name
    //'Address',
    //'City',
    //'Province',
    //'State',
    //'Zip',
    'Phone',
    //'URL',
    );

    return $fields;
    }

    add_filter( 'tribe_events_community_required_organizer_fields', 'my_organizer_community_required_fields', 10, 1 );
    function my_organizer_community_required_fields( $fields ) {
    $fields = array(
    'Organizer', //name
    'Phone',
    'Website',
    'Email',
    );

    return $fields;
    }

    Please try this code instead and let me know if it makes thing right,
    Best,
    Nico

    #1165201
    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 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Form code for required fields not working’ is closed to new replies.