How to implement filled in venue custom fields under admin settings?
-
I’m using the event organiser pro plugin.
What I’m trying to do is figure out how to display an eo_venue_map shortcode based on whether its a formal or informal tour. And this “formal” and “informal” are both categories.
So initially I thought about querying the event categories, but then I thought of a simpler solution. When creating a new event and clicking the + sign to add a new venue to it and when the category is chosen, for example “formal”, it will save this information in the eo_venue_meta table.
So for example, I could have two meta keys _formal and _informal and their meta value would be true or false if the venue contains at least one event matching that event category. Or the meta_values could contain a list of the event ID’s associated with the _formal meta_key.
So basically, i’de be saving the information about what category its in, straight into the eo_venue_meta table.
So then I could do something like:
$tourtype = $args[‘tour’];
switch ($region) {
case “BC”:$venue_querybc = array(
array(
‘key’ => ‘_state’,
‘value’ => ‘British Columbia’
),
array(
‘key’ => $tourtype,
‘value’ => ‘something like true’,
),
);$venue_ids = eo_get_venues( array( ‘meta_query’ => $venue_querybc ) );
$venue_slug_or_id = array_map(‘intval’,wp_list_pluck($venue_ids,’term_id’));
$mapflag = 1;
break;Where $tourtype would be either formal or informal of course.
Whats the best way to go about doing this when a category has been selected for an event after its been created? I’m not sure what files to edit under the Pro plugin and regular plugin.
Thanks
https://www.ads-software.com/extend/plugins/event-organiser/
- The topic ‘How to implement filled in venue custom fields under admin settings?’ is closed to new replies.