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.
Shortcode | Parameters | Description |
---|---|---|
[hello-link-to-ticket] | id, text | Returns 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, format | Returns 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] | id | Returns start time of event |
[hello-start-date-and-time] | id | Returns start date and time (no time for full-day events) |
[hello-end-date] | id, format | Returns the end date of event. For format, see hello-start-date |
[hello-end-time] | id | Returns end time of event |
[hello-end-date-and-time] | id | Returns end date and time |
[hello-location] | id | Returns the location of event |
[hello-event-ics] | id, text | Returns 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_links | Returns 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 slug | Used for custom event presentation templates |
Shortcode | Parameters | Description |
---|---|---|
[hello-link-to-event] | text | Returns 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, |
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:
Message | Meaning |
---|---|
Tickets not fully configured | At least one of the conditions for sales of tickets to the event is not fullfilled |
Shortcode can only be used when displaying events | You 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 category | You have inserted the shortcode in a product (or a post or a page), which is not a product of the correct category |
Product is orphaned | The product where the shortcode is inserted is not linked to from an event |
The plugin provides integration hooks in the form of actions and filters. A brief overview is provided here.
Action | Parameters | Description |
---|---|---|
hello_event_product_created | product_id, event_id | A WooCommerce product has been created to sell tickets |
hello_event_ready | The initiation of the plugin has finished |
|
hello_event_link_to_product_deleted | event_id | Link from event to WooCommerce product deleted (because the product has been deleted in WooCommerce) |
Filter | Parameters | Description |
---|---|---|
hello_event_display_link_to_ticket | event_id, product_id, html | Filter HTML output from the shortcode eme-link-to-ticket |
hello_event_display_link_to_event | product_id, event_id, html | Filter HTML output from the shortcode eme-link-to-event |
hello_event_display_event_list | $html | Filter 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.