
The all-night pharmacies of Paphos for 4th and 5th of January
An easy way to show the all-night today and tomorrow pharmacies of Cyprus per city (Nicosia, Limassol, Larnaca, Paralimni, Paphos).
A simple example
[cypharm show_title=false]
More Options
The plugin supports the following optional parameters:
city: select the Cyprus city between Nicosia, Limassol, Larnaca, Paralimni and Paphos (defaults to Paphos)title: Choose a custom title to use (defaults to false)Data source
By default the pharmacies are loaded from the National Opendata Portal of Cyprus (data.gov.cy). Under Settings Cyprus Pharmacies an administrator can switch to a custom API, entering its URL, a Client ID and a Client Secret. If that API fails for any reason, data.gov.cy is used for that request. The “Test connection” button checks the saved data source.
Performance Features
Developer Features
cypharm_cache_duration filter to modify cache durationclear_cache() methodYou can customize the cache duration by adding the following code to your theme’s functions.php file:
Set cache to 24 hours:
add_filter( 'cypharm_cache_duration', function() {
return 86400; // 24 hours in seconds
});
Set cache to 1 hour:
add_filter( 'cypharm_cache_duration', function() {
return 3600; // 1 hour in seconds
});
Set cache to 30 minutes:
add_filter( 'cypharm_cache_duration', function() {
return 1800; // 30 minutes in seconds
});
Disable caching (not recommended for production):
add_filter( 'cypharm_cache_duration', function() {
return 0; // No caching
});
Using a named function (recommended):
function my_custom_cypharm_cache_duration() {
return 7200; // 2 hours in seconds
}
add_filter( 'cypharm_cache_duration', 'my_custom_cypharm_cache_duration' );
This plugin connects to external services to get the list of on-duty (all-night) pharmacies. It does not work without them. data.gov.cy is always used by default; a custom API is used only if an administrator configures it.
National Opendata Portal of Cyprus (data.gov.cy)
The plugin requests the on-duty pharmacies schedule from the public API of the National Opendata Portal of the Republic of Cyprus.
[cypharm] shortcode is rendered and the requested city and day (today or tomorrow) are not in the plugin’s cache. Requests are made by your server, not by your visitors’ browsers.Custom API (optional, off by default)
An alternative API that serves the same schedule. It is used only if an administrator selects “Custom API” under Settings Cyprus Pharmacies and saves its URL, a Client ID and a Client Secret. The plugin does not include any default API URL or credentials; the service, its URL and the credentials are provided by its operator, and that operator’s terms of service and privacy policy apply.
[cypharm] shortcode is rendered and the requested city and day are not in the plugin’s cache, and when an administrator clicks “Test connection”. Requests are made by your server, not by your visitors’ browsers.