Skip to content

Instantly share code, notes, and snippets.

@elimn
Created June 18, 2015 16:25
Show Gist options
  • Select an option

  • Save elimn/363cafc5edf7cc8e46e3 to your computer and use it in GitHub Desktop.

Select an option

Save elimn/363cafc5edf7cc8e46e3 to your computer and use it in GitHub Desktop.
MT | TEC | Override the default country selected when adding events
<?php
/*
* This will override the default country selected when adding events
* If you want a frienly GUI for selecting all Venue/Organizer defaults, look at PRO's Default Settings Feature.
* https://theeventscalendar.com/product/wordpress-events-calendar-pro/
*/
class Tribe__Events__Default_Values_Override extends Tribe__Events__Default_Values {
public function country() {
return array('GB', 'United Kingdom');
}
}
function tribe_set_default_country( $value ) {
return new Tribe__Events__Default_Values_Override;
}
add_filter( 'tribe_events_default_value_strategy', 'tribe_set_default_country', 100, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment