Plugin für die Ausgabe der Angebote auf der Website des Naturparks Gantrisch.
Install and use as a normal plugin.
The code in the vendor/parks_api subfolder is provided by Schweizer Pärke. Download the current version here.
When the plugin is first installed, you will need to manually create the database tables using the
SQL script in vendor/parks_api/database/database.sql. You can use WP CLI for this: wp db import database.sql
.
Then call the API script in the browser (see Manual Update below.)
The current API version is 16. (Installed 15.9.2022)
The cron file shp_gantrisch_adb/vendor/parks_api/scripts/cron.php is called by a custom CRON task (which is registered when the plugin is activated). This is forcibly set to run at 1 a.m. every day. The script synchronises the custom database table content with the version from the remote API. The full path to the file is passed to a PHP cURL request.
- Set the required API hash and the Park ID under Settings » Angebotsdatenbank in WordPress.
- Get the API hash from the Export page at Schweizer Pärke.
- Get the Park ID from the Mein Park page at Schweizer Pärke.
The API synchronisation script can be run manually by calling the URL DOMAIN/wp-content/plugins/shp_gantrisch_adb/vendor/parks_api/scripts/cron.php directly in the browser
- Initial release version with API cron task implemented.
- Initial development version.
- Mark Howells-Mead (mark@sayhello.ch)
Use this code freely, widely and for free. Provision of this code provides and implies no guarantee.
Please respect the GPL v3 licence, which is available via http://www.gnu.org/licenses/gpl-3.0.html