Skip to content

Events Calendar Integration

James K edited this page Dec 19, 2021 · 2 revisions

If you use The Events Calendar plugin (free or pro), TouchPoint-WP provides the required API endpoint for the TouchPoint Custom Mobile app.

Usage

For basic usage, from the WordPress Admin, go to Settings > TouchPoint-WP > Events Calendar and use the displayed URL for the Custom mobile app.

You can customize which events are displayed by adding query parameters to the URL that correspond to options for the tribe_get_events method. By default, the following parameters are used:

  • ends_after = now
  • event_display = custom
  • total_per_page = 20
  • hide_subsequent_recurrences = true

For instance, if you want to show subsequent recurrences, you would override the default by adding the hide_subsequent_recurrences parameter to the URL with a false value, so it would end with something like: /touchpoint-api/app-events?v=x.x.x&hide_subsequent_recurrences=false

Filters

tp_app_events_css_url

By default, the Custom App's events show content that's seriously lacking in style. You can enable our default styling in the settings, but if you want to provide your own custom CSS instead, you can specify the URL for the script file. We strongly recommend keeping your CSS file light and simple. The app can't handle much advanced styling.

This script file will only be included if the event has body content.

Example: Uses the EventFormatting.css file from a CDN. (This CDN is fictional; this won't work as-is.)

function my_app_style_filter($path) {
    return "https://cdn.example.com/EventFormatting.css"
}
add_filter('tp_app_events_css_url', 'my_app_style_filter', 10, 3);

tp_app_events_content

You can use this to append or modify content that goes to the Events Calendar. This comes along before the scripts and styles are appended.

Example: Add a heading to the top of each event's content.

function my_app_events_content_filter($content) {
    return "<h2>Hello!</h2>" . $content;
}
add_filter('tp_app_events_content', 'my_app_events_content_filter', 10, 3);
Clone this wiki locally