/** * Returns an array with address details of the event's venue. * The keys consist of * * * 'address' * * 'city' * * 'state' - the state/province/county of the venue * * 'postcode' * * 'country' * * If used without any arguments uses the venue of the current event. * * ### Examples * Return the details of venue 16. **(Please note when using the ID it must be an integer - that is 16 not '16').** * <code> * $address_details = eo_get_venue_address(16); * //$address_details = eo_get_venue_address('16'); This method is incorrect. * </code> * Print the post-code of venue 'my-venue-slug' * <code> * $address_details = eo_get_venue_address('my-venue-slug'); * echo "The post code of 'my-venue-slug' is: ".$address_details['postcode']; * </code> * Return the details of the venue of event 23 we can use `{@see eo_get_venue()}` to obtain the venue ID. * <code> * $venue_id = eo_get_venue(23); * $address_details = eo_get_venue_address($venue_id); * </code> * * @since 1.0.0 * @param int|string $venue_slug_or_id The venue ID (as an integer) or slug (as a string). Uses venue of current event if empty. * @return array Array of venue address details */ function eo_get_venue_address($venue_slug_or_id = '') { $address = array(); $venue_id = eo_get_venue_id_by_slugorid($venue_slug_or_id); $address_keys = array_keys(_eventorganiser_get_venue_address_fields()); foreach ($address_keys as $meta_key) { $key = trim($meta_key, '_'); $address[$key] = eo_get_venue_meta($venue_id, $meta_key); } return $address; }
function handle_venuemap_shortcode($atts) { global $post; self::$add_script = true; //If venue is not set get from the venue being quiered or the post being viewed if (empty($atts['venue'])) { if (eo_is_venue()) { $atts['venue'] = esc_attr(get_query_var('term')); } else { $atts['venue'] = eo_get_venue_slug(get_the_ID()); } } $venue_id = eo_get_venue_id_by_slugorid($atts['venue']); return self::get_venue_map($venue_id, $atts); }
/** * Retrieves the permalink for the ICAL event feed for a venue. A simple wrapper for `{@see get_term_feed_link()}`. * * If you pass an integer this is assumed to be the term ID of the category. If you pass a string it * assumed to be the slug. * * @since 2.2 * @param string|int $venue_slug_or_id Category ID as an **integer**, or slug as a **string** * @return string The link to the ICAL event category feed. */ function eo_get_event_venue_feed($venue_slug_or_id) { $venue_id = eo_get_venue_id_by_slugorid($venue_slug_or_id); if (!$venue_id) { return false; } return get_term_feed_link($venue_id, 'event-venue', 'eo-events'); }
function eo_get_venue_map($venue_slug_or_id = '', $args = array()) { $venue_id = eo_get_venue_id_by_slugorid($venue_slug_or_id); return EventOrganiser_Shortcodes::get_venue_map($venue_id, $args = array()); }