Other Documentations
Taxonomies of EventON
March 15, 2019
EventON use several taxonomies through out the plugin to allow great customization and increase the usability of this plugin for multiple needs. Below are the list of taxonomies used in eventON
Taxonomy Slug | Description |
---|---|
event_location | Store each event location data for events to be reused for events |
event_organizer | Store each event organizer data for events to be reused for events |
event_type | Event Type taxonomy is one of 5 custom type taxonomies you can create to use and assign events to them. |
event_type_{x} | These are the rest of event type taxonomies with x being the number representing the custom taxonomy out of 5 in the order they are activated via eventON Settings. |
Event Taxonomy Meta Values
Since version 2.4 event location and organizer data for each event is saved in respective taxonomy and taxonomy meta.
(Before version 2.4.7) You can use get_option(‘taxonomy_{$ID}’) where ID is the taxonomy term ID.
(From version 2.4.7) All the taxonomy meta values are saved in wordpress options and can be fetched using get_option( “evo_tax_meta”); sorted by taxonomy name and taxonomy term ID.
Event Location and Organizer
Location and organizer for events are saved as taxonomies in wordpress since eventon version 2.4. Meta data mentioned below for location and organizer are saved as term meta.
Taxonomy Meta Data Fields
Event Location
location_address – location address
location_lon & location_lat – longitude and latitude values for the address
evcal_location_link – link to a location
evo_loc_img – location image attachment ID for wordpress media
Event Organizer
evcal_org_contact – organizer contact information
evcal_org_address – organizer address
evcal_org_exlink – external link to organizer to be linked to
_evocal_org_exlink_target – whether to open external link in new window or not
evo_org_img – organizer image attachment ID for wordpress media
Term Meta Data Handling
Location and organizer term meta data can be accessed and updated from below functions.
Get Location and Organizer Taxonomy Meta Data
1 |
evo_get_term_meta($tax, $term_id); |
$tax = the taxonomy name
$term_id = taxonomy term ID for the location or organizer
Return
This function will return an array of taxonomy meta data or false on empty.
Save Location and Organizer Taxonomy Meta Data
1 |
evo_save_term_metas($tax, $term_id, $data); |
$tax = the taxonomy name
$term_id = taxonomy term ID for the location or organizer
$data(array) = Must be sent as an array of data with meta data field as the array key.
eg. $data = array(‘evcal_org_contact’=>’Contact Information’);
Return none.
Basic Custom Usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?php $event_terms = get_terms( 'event_type', array( 'orderby'=>'name', 'hide_empty'=>true ) ); if(!empty($event_terms) && !is_wp_error($event_terms)){ foreach($event_terms as $event_term){ // code for each event term echo $event_term->name; } } ?> |
Get Event’s Terms
1 2 3 4 5 6 7 8 |
<?php $taxonomy = 'event_location'; $event_terms = wp_get_post_terms($p_id, $taxonomy); if ( $event_terms && ! is_wp_error( $event_terms ) ){ $event_location_term = $event_terms[0]; $location_name = $event_location_term->name; } ?> |
Did this article help you? If not, send us a ticket via helpdesk