Custom Fields default setting

Home Forums Calendar Products Community Events Custom Fields default setting

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #60948
    gurban308
    Participant

    In the admin view of “Add New Event” the Additional Event Fields are all preset by default to (None), they will not appear in the event listing unless you check them.

    In the public view of “Submit An Event” (community/add) all of the Event Custom Fields are by default preset to the first entry, when submitted all custom fields are added to the event listing.

    How to I change the default to None?

    Here is the code within Community – Views – event_meta.php
    lines 48-54

    ?php elseif($customField[‘type’] == ‘dropdown’): ?
    select name=”
    ?php $options = explode( “\n”, $customField[‘values’] ) ?
    ?php foreach ($options as $option): ?
    option value=’ ?php echo esc_attr( $option ) ? ‘ ?php selected( trim( $val ), trim( $option ) ) ? ?php echo esc_html( stripslashes( $option ) ) ?
    /option
    ?php endforeach ?
    /select

    Is this what needs to be altered?
    If so, how to change the code to achieve the desired “None” default value?

    Thanks

    #60997
    Casey
    Participant

    Could you either give me a login so I can view your Event Submission form, or enable anonymous submissions so I can take a look? Thanks!

    #61068
    gurban308
    Participant

    This reply is private.

    #61077
    Casey
    Participant

    Ok, you should be able to paste this code into your theme’s functions.php file: https://gist.github.com/ckpicker/6271748

    Let me know if that does the trick! Thanks!

    #61088
    gurban308
    Participant

    It did work in setting up the “Please select an option”; however, it puts up an alert that you must select an option for all fields. Most events will only qualify for one of the fields, not one from each. Any way to set the default so it is optional, not required?

    #61092
    Casey
    Participant

    Sorry about that! I think I misunderstood and assumed you wanted those fields to be required. Here’s the modified code: https://gist.github.com/ckpicker/6271981

    Let me know if that’s what you’re looking for. Thanks!

    #61098
    gurban308
    Participant

    Worked like a charm…..

    #61101
    Casey
    Participant

    Thanks for confirming that this got you sorted. Unless you disagree, I’m going to mark this thread “Answered” and close it out.

    We really appreciate your support and please let us know if you need anything else in the future. If you find yourself with a few minutes and would be so kind as to give us a “Works” rating or a positive star voting on the WordPress.org repo (http://wordpress.org/extend/plugins/the-events-calendar/), or even a shoutout to your followers on Facebook or Twitter, it would mean a lot to us. Thanks again for using the plugin.

    #979554
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Custom Fields default setting’ is closed to new replies.