Shortcode builder UI for the Opening Hours WordPress plugin
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public
src
.gitignore
.prettierrc
README.md
package.json
tsconfig.json
tsconfig.test.json
tslint.json
yarn.lock

README.md

Opening Hours Shortcode Builder

The Opening Hours Shortcode Builder offsers a UI for interactively building shortcodes for the Opening Hours WordPress Plugin.

Demo

A demo can be seen at https://janizde.github.io/opening-hours-shortcode-builder/

Options

The shortcode builder can be given initial options, such as the available sets that the user can choose among. These options are contained in an option object whose JSON representation is then base64 encoded and set as the hash portion in the url.

{
  "sets": {
    "0": "First Set",
    "3": "Second Set"
  },
  "shortcode": "op-is-open"
}

The URL then looks like

https://domain.com/path/to/shortcode/builder#eyJzZXRzIjp7IjAiOiJGaXJzdCBTZXQiLCIzIjoiU2Vjb25kIFNldCJ9fQ==eyJzZXRzIjp7IjAiOiJGaXJzdCBTZXQiLCIzIjoiU2Vjb25kIFNldCJ9LCJzaG9ydGNvZGUiOiAib3AtaXMtb3BlbiJ9
Name Type Description
sets object<string, string> Object mapping set it to set name. The specified sets will be used as selectable presets fpr the set id
shortcode string String containing the initial shortcode id. Possible values are op-overview, op-is-open, op-holidays or op-irregular-openings

This project was bootstrapped with Create React App.