內容簡介
這個外掛是使用簡單的方式,在賽普勒斯各城市(Nicosia、Limassol、Larnaca、Paralimni、Paphos)顯示今晚和明天營業的所有藥局。
簡單範例:
[cypharm show_title=false]
更多選項:
這個外掛支援以下可選參數:
city:選擇賽普勒斯城市 (預設為Paphos),可選城市為 Nicosia、Limassol、Larnaca、Paralimni、Paphos
title:選擇自訂的標題 (預設為false)
感謝
Εθνική Διαδικτυακή Πύλη Ανοικτών Δεδομένων
外掛標籤
開發者團隊
原文外掛簡介
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)
Performance Features
Caching: API responses are cached for 12 hours to improve performance and reduce API calls
Cache Management: Admin interface to clear cache when needed
Smart Loading: Only makes API calls when cached data is expired or doesn’t exist
Developer Features
Customizable Cache Duration: Use the cypharm_cache_duration filter to modify cache duration
Cache Management: Programmatic cache clearing with clear_cache() method
Extensible: Easy to extend with additional caching features
Customizing Cache Duration
You 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' );
Credits
National Opendata Portal
