Home › Forums › Calendar Products › Community Events › Custom Fields default setting
- This topic has 8 replies, 3 voices, and was last updated 10 years, 10 months ago by
Support Droid.
-
AuthorPosts
-
August 18, 2013 at 11:37 am #60948
gurban308
ParticipantIn 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 ?
/selectIs this what needs to be altered?
If so, how to change the code to achieve the desired “None” default value?Thanks
August 19, 2013 at 6:14 am #60997Casey
ParticipantCould 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!
August 19, 2013 at 9:42 am #61068gurban308
ParticipantThis reply is private.
August 19, 2013 at 10:29 am #61077Casey
ParticipantOk, 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!
August 19, 2013 at 10:45 am #61088gurban308
ParticipantIt 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?
August 19, 2013 at 10:47 am #61092Casey
ParticipantSorry 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!
August 19, 2013 at 10:53 am #61098gurban308
ParticipantWorked like a charm…..
August 19, 2013 at 10:54 am #61101Casey
ParticipantThanks 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.
July 7, 2015 at 6:27 am #979554Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘Custom Fields default setting’ is closed to new replies.
