The Pro version of Open Table Widget supports the use of shortcodes throughout your website. The plugin’s shortcode options vary depending on how you would like to use the widget. The following instructions outline various shortcode options that are supported by the plugin. Use these option to modify the output and customize the content and look-and-feel of the widget.

You can use the Open Table Widget shortcode within your page and post content as you would any normal shortcode. Please ensure you are using the shortcode within the WordPress loop.

Quick shortcode usage instructions

  1. Determine how you would like to use the widget and set the proper display_option value
  2. Set the appropriate restaurant ID(s) or cities to connect the widget to Open Table
  3. Add any additional options such as widget_style and title to customize further

Now that you know the basics of setting up a widget via shortcode, let’s dive deeper.


restaurant_id
Sets the widget reservation restaurant. Used for single restaurant reservations; i.e. display_option 0 (see below for more info).
restaurant_ids
Sets multiple restaurants for the user to select from to create a reservation. Used for multiple restaurant choices; i.e. display_option 1 (see below for more info).
restaurant_ids
Sets the widgets display functionality.

Output Options

The Open Table Widget shortcode is capable of the same output options as the standard widget. You may create one or many widgets that display a single restaurant reservation, multiple restaurants or a city-based user restaurant lookup. To set your preferred usage you will need to set the shortcode display option.

display_option
Sets the widgets display functionality.
  • 0 – Single Restaurant Reservation
  • 1 – Predefined Restaurants List
  • 2 – City Restaurant Lookup

Working Examples:

Single restaurant reservation. The display option parameter expects only a single Open Table restaurant ID:

Single Restaurant Reservation Shortcode Example

[open-table-widget display_option="0" restaurant_id="49051" title="Single Restaurant Reservation"]

Click the code to select all

Multiple restaurant reservations (not limited to city or country). The display option parameter expects the restaurant’s Open Table ID followed by a bar separator “|” and then the restaurant name. Individual listings need to be separated by a comma and space. Tip: you can use the lookup within the widget options to help compile your restaurant list.

Multiple Restaurant Reservations Shortcode Example

[open-table-widget display_option="1" restaurant_ids="The Optimist|79366,The Open Door Cafe|105511,Searsucker|49051,Wolfes Louisiana Pantry|108616" title="Predefined Restaurants List"]

Click the code to select all

City-based restaurant lookups: expects a comma separated list of cities supported by Open Table. If the city is not within Open Table’s database no restaurants will display. Please be sure your city is supported prior to using this feature.

City-based Restaurant Lookup Shortcode Example

[open-table-widget display_option="2" lookup_city="San Diego, Tucson" title="City Restaurant Lookup"]

Click the code to select all

Customizing Language and Location

You may need to update the Open Table language option depending on where in the world your restaurant is located. Open Table supports various locations and the following shortcode options allow you to set the widget according the your specific needs.

widget_language
Sets the widgets language and location functionality.
  • ca-engdefault language; US English
  • ger-eng – German English
  • ger-ger – German
  • uk – British English
  • mx-mx – Mexico Spanish
  • mx-eng – Mexico English
  • jp-jp – Japanese
  • jp-eng – Japanese English

Working Examples:

The following shortcodes display how you can display restaurant reservation forms using the shortcode for restaurants in a variety of locations across the globe.

UK – “Top Table” Support Single Restaurant

UK Shortcode Example

[open-table-widget display_option="0" restaurant_id="69847" widget_language="uk"]

Click the code to select all

Cancun, Mexico with English Language Shortcode Example

[open-table-widget display_option="0" restaurant_id="15979" widget_language="mx-eng"]

Click the code to select all

Cancun, Mexico with City Restaurant Lookup and Spanish Language Shortcode Example

[open-table-widget display_option="2" lookup_city="Cancun" widget_language="mx-mx"]

Click the code to select all

As you can see it’s easy to customize the location and language of the shortcode using the parameters found above.

Customizing the Reservation Time Selection

You may want to customize the reservation time select option according to when you would like to accept reservations. For instance, perhaps you would like a widget for lunch reservations and another for dinner. This is entirely possible as of version 1.5 of Open Table Widget.

time_start
Modifies the start time to begin accepting reservations.
time_end
Modifies the end time to stop accepting reservations.
time_default
Sets the default time selected when the widget is first loaded. Please ensure this time falls between the time_start and time_end options.
time_increment
Adjust the number of minutes between reservation times. Default value is 30.
party_size
Set a preferred default party size for guests using the reservation widget. If you do not set this, the default is a “4” party table.
max_seats
Adjusts the maximum seats for your restaurant when making the reservation. If you do not set this, the default is “6”.

Shortcode with ALL the attributes

[open-table-widget display_option="0" time_start="5:00pm" time_end="11:00pm" time_default="8:00pm" time_increment="15" restaurant_id="49051" title="My Shortcode!" max_width="500px" align="left" widget_style="minimal-dark"]

Click the code to select all

Visual Display Options

The Open Table Widget shortcode allows for the same granular customizations as found within the widget. With little effort you can customize labels, inputs, themes and more using the following options.

Customizing the Theme

Modify the theme used for the particular shortcode is easy and you can have multiple widgets on a page use different themes.

widget_style
Sets the widgets theme output.
  • minimal-light – default theme; Minimal light theme
  • minimal-dark – Dark version of the minimal theme
  • shadow-light – Shadow light theme
  • shadow-dark – Dark version of the shadow light theme
  • inset-light – Inset light theme
  • inset-dark – Dark version of the inset light theme
  • bare-bones – Bare bones theme

Customizing the Content

title
Customize the widget title.
pre_content
Add content and images before “preceding” the widget form. HTML supported.
post_content
Add content and images after “post” the widget form. HTML supported.

Working Example:

Shortcode showing Content and Theme attributes

[open-table-widget display_option="0" restaurant_id="49051" title="Custom Pre and Post Content" pre_content="This is some pre-content here... I could add a welcome message or anything really." post_content="I can also add content here after the form. See how it shows up after the form?"]

Click the code to select all

Width and Alignment

If you are placing the widget within your post content you may want to set a max-width and align the widget to the right or left depending on how you would like it to display for your users. The following shortcode options will allow you to modify the max-width and alignment property:

max_width
Set a maximum width for the width. You can use percentages (%) or pixels (px) based values.
align
Float the widget to the right or left of your content. Adds classes to the widget wrapper to float the element with margins. Tip: you can overwrite the margins by overriding the classes within your theme’s css.
  • left – Float the widget to the left of content
  • right – Float the widget to the right of content

Shortcode showing Alignment and Width Attributes

[open-table-widget display_option="0" restaurant_id="49051" title="Single Restaurant Reservation" max_width="500px" align="left"]

Click the code to select all

Labels, Placeholders and Inputs

You may customize the text see on just about any part of the widget. This is useful if you want to provide some unique content, styles or speak any language besides English.

label_date
Customize the “Date” label.
label_time
Customize the “Time” field label.
label_party
Customize the “Party Size” label.
input_submit
Customize the “Find a Table” input submit button text.

Display Option Specific Labels

label_city
Customize the “City” field label. Only used with City Restaurant Lookup display option enabled.
label_multiple
Customize the multiple city select label. Only used with the Predefined Restaurants List display option.