Home › Forums › Calendar Products › Events Calendar PRO › Automatic state
- This topic has 3 replies, 2 voices, and was last updated 6 years, 5 months ago by 365naples.
-
AuthorPosts
-
October 16, 2017 at 12:35 pm #1364288365naplesParticipant
Still wondering why if default state is set it does not stay; for instance, ours if FL and never changes.
October 17, 2017 at 1:38 pm #1364922PatriciaMemberHi there,
Thank you for reaching out to us!
I’m so sorry to hear that you are having problems with your calendar. Let me help you to solve this!
This is a known issue that wasn’t fixed by our development team yet, but in the mean time, we have a workaround available.
Could you please add the following snippet in your theme’s functions.php file? This will help you to solve the problem:
/* Tribe, set default values for venues in new event page */ function tribe_set_default_values( ) { // bail if we are not in an events page if( !isset($_GET['post_type']) || 'tribe_events' != $_GET['post_type'] ) return false; $screen = get_current_screen(); // bails if it's not Add Event page if ( 'add' != $screen->action ) return false; // bail if PRO is not active if ( !class_exists('Tribe__Events__Pro__Default_Values') ) return false; $defaults = new Tribe__Events__Pro__Default_Values; $default_city = $defaults->city(); $default_state = $defaults->state(); $default_country = $defaults->country(); $default_country = $default_country[1]; ?> <script type="text/javascript"> jQuery('document').ready ( function ( $ ) { $('input[name="venue[City][]"]' ).val('<?php echo $default_city; ?>'); $('select[name="venue[Country][]"]').val('<?php echo $default_country; ?>'); $('select[name="venue[Country][]"]').change(); $('select[name="venue[State]"]' ).val('<?php echo $default_state; ?>'); }); </script> <?php } add_action( 'admin_print_footer_scripts', 'tribe_set_default_values' );
I hope this helps! Let me know if you have any other questions and I’ll be happy to assist!
Best Regards,
Patricia
November 8, 2017 at 8:36 am #1378080Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘Automatic state’ is closed to new replies.