Helsinki Museot TPR
Helsingin Kaupunginmuseon verkkosivustoprojektin TPR-lisäosa
by HiQ · github.com/city-of-helsinki/wordpress-helfi-museot-tpr
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/city-of-helsinki/wordpress-helfi-museot-tpr/archive/refs/heads/main.zipIntegrates the Helsinki TPR API into Wordpress sites. Updates the location post type provided by the site theme with unit information fetched from the API.
The plugin is loosely based on the general Helsinki TPR plugin, but its development is not tied to that version.
Dependencies
Required
The plugin does not create content types of its own. It updates the location custom post type and its fields, both of which come from the theme.
Recommended
This is not required, but without it only one language version of each museum is created and kept up to date.
- Polylang
Configuration
Fetching units
Once installed, a new settings page TPR-kohdeasetukset will be created under the Settings menu.
A new museum can be added from the Lisää museo section by searching units by their name or TPR id. Found results will be displayed in a table. A unit can be imported to the site with the Lisää -option.
Importing a unit creates a post for said unit as a draft, so that it can be reviewed before it becomes publicly visible. When Polylang is active, Finnish, English and Swedish versions are created and linked as translations of each other.
Imported museums are listed under Hallinnoidut museot, and their information can be fetched again with the Synkronoi and Synkronoi kaikki -options. The outcome of each run is recorded under Synkronointiloki.
Displaying units
The plugin does not output anything of its own. Museums are displayed by the theme as regular location posts.
Information received from the API is stored in separate meta fields, and it is used only when the corresponding theme field is empty. Anything an editor fills in takes precedence. This applies to opening hours, addresses, contact details and the journey planner link.
The values received from the API are shown read-only in the Tiedot TPR-rajapinnasta metabox on the post edit screen. A unit picture is imported only when the museum has no featured image, and an existing image is never replaced, so the image can also be set by hand.
Development
The plugin has no build step. All files are PHP and are loaded directly from the repository.
Requires WordPress 6.9 and PHP 8.0 or newer.
Collaboration
Raise issues for found bugs or development ideas. Feel free to send pull requests for bugfixes and new or improved features.