<– Back to Hello Event

Hello Event – Technical Documentation

Shortcodes to be used on the event pages

The plugin has a built-in way of presenting the events, which is enough to get you started. On the plugin settings page you choose which event data to include in the built-in presentation, with all selected by default.

If you would like to define a personalized presentation the plugin provides various shortcodes to show different event information (such as location, map, start date, etc). These shortcodes are intended to be used (by developers) on a specific theme template page, but could also be used within the content part of the events – although this is not recommended since it will not give you much control over of how things are presented.

These shortcodes all have an optional id parameter. The value of this parameter is automatically set by the URL-parameter ‘event_id’. This URL-parameter is always set when visiting an event from the Event Archive page. In the unlikely case that you want to show some information from a particular event on a different page on your site, you may include this parameter when using the shortcode.

ShortcodeParametersDescription
[hello-link-to-ticket]id, textReturns the text with a link to the ticket of the current event in the Woocommerce shop, provided that you have enabled ticket sales, defined a price and publsihed the ticket product in WooCommerce
[hello-start-date]id, formatReturns start date of event. The format is that chosen in the plugin settings. This can be overridden by setting the optional parameter format to 'iso', in which case the format will always be yyyy-mm-dd
[hello-start-time]idReturns start time of event
[hello-start-date-and-time]idReturns start date and time (no time for full-day events)
[hello-end-date]id, formatReturns the end date of event. For format, see hello-start-date
[hello-end-time]idReturns end time of event
[hello-end-date-and-time]idReturns end date and time
[hello-location]idReturns the location of event
[hello-event-ics]id, textReturns a button that when clicked will download the event in the ICS format. The text is shown on the button label
[hello-event-map]show_map, show_map_linksReturns a text string with the address.
If show_map is true (the default): Returns a map presentation using the map service provider selected in the settings (eg. Google map or OpenStreet map) of the event location. If show_map_links is true (default true): Returns links to Google maps and OpenStreet map to display maps in new browser tab.
[hello-event-openstreet-map]Returns an OpenStreet map presentation of the event location
[hello-event-google-map]Returns a Google map presentation of the event location
[hello-default-event]id or slugUsed for custom event presentation templates

Shortcodes to be used on Woocommerce products

ShortcodeParametersDescription
[hello-link-to-event]textReturns the text with a link to the event of the current ticket,
[hello-id-of-event]Returns the post id of the event of the current ticket,

 

Errors and debugging

If you follow the guidelines everything should work. But if it doesn’t, don’t dispair. On the plugin settings page you can switch on debugging. As a result, you will get useful debug information generated by the shortcodes when you are logged in and have the WordPress capability edit_posts (i.e. any user role better than subscriber).  The debug messages include the following ones:

MessageMeaning
Tickets not fully configuredAt least one of the conditions for sales of tickets to the event is not fullfilled
Shortcode can only be used when displaying eventsYou have inserted the shortcode on a page or post which is not an event
Shortcode can only be used for products of the eme-event categoryYou have inserted the shortcode in a product (or a post or a page), which is not a product of the correct category
Product is orphanedThe product where the shortcode is inserted is not linked to from an event

 

Information to plugin and theme developers

The plugin provides integration hooks in the form of actions and filters. A brief overview is provided here.

Actions

ActionParametersDescription
hello_event_product_createdproduct_id, event_idA WooCommerce product has been created to sell tickets
hello_event_readyThe initiation of the plugin has finished
hello_event_link_to_product_deletedevent_idLink from event to WooCommerce product deleted (because the product has been deleted in WooCommerce)

Filters

FilterParametersDescription
hello_event_display_link_to_ticketevent_id, product_id, htmlFilter HTML output from the shortcode eme-link-to-ticket
hello_event_display_link_to_eventproduct_id, event_id, htmlFilter HTML output from the shortcode eme-link-to-event
hello_event_display_event_list$htmlFilter HTML output from the shortcode eme-list-events

There are many more hooks available, and the list is growing. The best place to find up-to-date information is the source code.