Developer docs

WordPress plugin

Install the BookDinePlay Booking Widget plugin from the release zip, set your publishable key, and place the shortcode on any page or post.

The WordPress plugin puts the booking widget on any page or post with one shortcode. It does not bundle the SDK: it loads https://cdn.bookdineplay.com/sdk/v0/bookdineplay.js on pages that use the shortcode, so SDK fixes reach your site without a plugin update.

Install

  1. Download bookdineplay-<version>.zip from the latest GitHub release.
  2. In wp-admin go to Plugins → Add New → Upload Plugin, choose the zip, click Install Now, then Activate "BookDinePlay Booking Widget".
  3. Go to Settings → BookDinePlay and paste your venue's publishable key (bdp_pk_…) from the console under Venue → API keys. The field accepts only a value starting with bdp_pk_; a secret key is rejected, because this setting is embedded in your public pages.

Requires WordPress 6.0 or newer and PHP 7.4 or newer.

Add the shortcode

In any page or post:

[bookdineplay_widget venue="your-venue" types="RestaurantTable,BilliardTable,DartBoard"]
Attribute Default Meaning
venue demo-sportsbar Your venue's slug. Always set it.
types RestaurantTable,BilliardTable,DartBoard,BowlingLane Comma-separated resource types to offer: RestaurantTable, BilliardTable, DartBoard, Shuffleboard, BowlingLane, EventArea.
theme auto auto, light or dark — see Theming.
api https://api.bookdineplay.com Only for a private deployment.
key the key from Settings A per-shortcode publishable key, for a site that embeds more than one venue. Same bdp_pk_ rule; anything else is refused and that shortcode renders nothing (administrators see the missing-key notice) — it does not fall back to the Settings key.

Several shortcodes on one page each render their own widget.

Allow your site's origin

The key you paste is protected by its origin allowlist, not by secrecy. Add your site's origin — https://www.your-venue.example, scheme and host exactly as visitors load it — to the key under Venue → API keys in the console. Without it every booking request is refused with 403 origin-not-allowed. Authentication has the rules.

When the widget does not show

  • Ordinary visitors see nothing, administrators see a notice — no publishable key is configured. Set it under Settings → BookDinePlay (or per shortcode with key).
  • The settings page rejected the key — you pasted a secret key (bdp_sk_…). Copy the publishable key from the console instead.
  • The widget renders but every request fails — the site's origin is not on the key's allowlist, or the api attribute points somewhere wrong. The browser's network tab shows the problem type.

Themes and styling

The widget renders inside a Shadow DOM, so your theme's CSS does not affect it — and it does not affect your theme. To match colors, corners and font, set the --bdp-* custom properties in your theme's stylesheet or in Appearance → Customize → Additional CSS; Theming lists them.

Updates, privacy and CSP

  • SDK updates within the current major line arrive automatically through sdk/v0/; a new major line only ever comes with a plugin update.
  • Pages with the shortcode load one script from cdn.bookdineplay.com and talk to api.bookdineplay.com. If your site keeps a list of third-party hosts (privacy notice, CSP, firewall), add both — the JavaScript SDK guide shows the CSP directives.
  • The plugin stores no secrets and sends nothing anywhere itself; only the browser talks to the API, with the publishable key.

Next steps

  • Theming — colors, radius and font.
  • CDN — what sdk/v0/ promises and how releases reach your site.