Purpose-built Bokun imports for WordPress
Bokun Bookings Management lets tour and activity operators pull reservations from the Bokun API, persist them as the
bokun_booking custom post type, and make the data actionable inside WordPress dashboards, Elementor
widgets, or custom workflows. Multiple API credentials, ARIA-friendly progress bars, and deeply integrated
shortcodes mean staff can fetch bookings without touching wp-admin.
Repository layout
Everything ships as a standard WordPress plugin that lives under wp-content/plugins/bokun-bookings-management.
├── bokun-bookings-management.php
├── includes/
│ ├── bokun-bookings-manager.php
│ ├── bokun_settings.class.php
│ ├── bokun_shortcode.class.php
│ ├── bokun_settings.view.php
│ └── bokun_booking_history.view.php
├── assets/
│ ├── css/
│ ├── js/
│ └── images/
└── addons/
Feature highlights
Multiple credentials
Store, validate, and remove any number of Bokun API key/secret pairs. Each set becomes its own import context so you can process bookings from multiple Bokun tenants without editing code.
Progress-aware imports
Admin/AJAX actions (such as bokun_bookings_manager_page) paginate through the Booking Search endpoint, write bookings to WordPress, and report progress, queued contexts, and errors back to the UI.
First-class post type
Reservations are normalized into the bokun_booking post type with Booking Status, Product Tag, and Team Member taxonomies that power filtered dashboards, Elementor widgets, or REST/GraphQL queries.
Dashboards & shortcodes
Shortcodes like [bokun_booking_dashboard], [bokun_booking_history], and [bokun_fetch_button] bring dashboards, DataTables, and fetch buttons to any page—no admin access required.
Rich booking history
The admin history view and history shortcode share a responsive DataTable with filters, CSV export (via DataTables Buttons/JSZip), and capability checks to prevent unauthorized viewing.
Product tag media jobs
Trigger a background importer that pulls gallery images for every Bokun Product Tag and assigns them to WordPress taxonomy terms for polished, on-brand UI.
Accessible status updates
Both the admin fetch button and the public [bokun_fetch_button] shortcode share ARIA-enabled progress bars and polite live regions so screen-reader users stay informed.
Installation
- Download the latest release zip via the button above or clone the repository into
wp-content/plugins/. - Make sure the directory is named
bokun-bookings-managementso WordPress can detect the plugin header. - Activate the plugin. The first activation creates the
wp_bokun_booking_historytable and redirects to the settings screen.
Configure API credentials & dashboard output
- Visit Bokun Bookings Management → Settings.
- Add one or more API key/secret pairs using the repeatable “Add another API” interface—each set becomes a named context.
- Select a page that should automatically append the booking dashboard or drop the
[bokun_booking_dashboard]shortcode anywhere. - Use the Fetch Booking panel to start the importer and watch real-time progress without refreshing.
- Optional: run the Product Tag image importer to sync taxonomy media from Bokun.
Import behavior
- Every credential pair is normalized into a numbered import context (API 1, API 2, etc.) that runs sequentially.
- The plugin calls
/booking.json/booking-searchwith a default date window from yesterday through one month ahead—filterbokun_booking_items_per_pageto adjust pagination. - Bookings are stored as
bokun_bookingposts and forced topublishstatus so future-dated reservations appear immediately. - Each create/update action logs to
wp_bokun_booking_historywith actor, status, and “checked” metadata for auditing.
Shortcodes
| Shortcode | Purpose | Attributes |
|---|---|---|
[bokun_fetch_button] |
Displays a primary button that triggers the AJAX importer plus the shared progress UI. | None. |
[bokun_booking_history] |
Outputs the responsive, filterable booking-history DataTable anywhere. | limit (default 100), capability (default manage_options), export (CSV filename slug). |
[bokun_booking_dashboard] |
Renders the dashboard cards, filters, and KPIs for team members and partners. | None. |
Booking history UI
The built-in Booking History submenu and shortcode both query wp_bokun_booking_history and render a responsive DataTable with collapsible filters, column search, CSV export, and capability checks. The view handles missing tables gracefully—for example when the plugin has been uploaded but not activated yet.
Hooks & filters
bokun_booking_items_per_page– Change how many bookings the importer requests per API page (default 50).bokun_booking_request_timeout– Adjust the cURL timeout in seconds (default 300).bokun_booking_history_page_limit– Control how many rows the admin history screen displays (default 100).bokun_txt_domain– Fires after the text domain loads so you can register additional translations.
Development workflow
- Install the plugin in a local WordPress environment for testing.
- Run
npm installandnpm run devinsideassets/if you extend the CSS/JS helpers (current build is plain CSS/JS). - Use
wp i18n make-potto refresh translation catalogs whenever you edit user-facing strings. - Follow WordPress coding standards, escape output, and lint PHP with tools such as
wp coding standards.
Troubleshooting
- Error: No API credentials available for this import. – Save at least one credential pair; legacy single-key installs are migrated the next time you load the settings screen.
- Booking history table missing. – Reactivate the plugin to run
dbDeltaand recreatewp_bokun_booking_history. - Imports timing out. – Narrow the booking window, reduce
bokun_booking_items_per_page, and confirm your host allows outbound HTTPS calls toapi.bokun.io.
Need help?
Email lab@websagesolutions.com with deployment questions, feature requests, or support needs.