| 开发者 | spelhubben |
|---|---|
| 更新时间 | 2025年10月26日 21:20 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 6.8 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[spelhubben_weather] anywhere shortcodes are supported.[spelhubben_weather][spelhubben_weather place="Gothenburg" layout="compact" map="1" animate="1"][spelhubben_weather lat="57.7089" lon="11.9746" layout="inline" map="0" show="temp,icon"][spelhubben_weather place="Umeå" layout="detailed" forecast="daily" days="5" providers="smhi,yr,openmeteo"]From public APIs such as Open-Meteo, SMHI and Yr/MET Norway. You choose providers under Settings → Spelhubben Weather or per block/shortcode/widget via the providers attribute.
No. For Yr/MET Norway it’s recommended to include contact info (email/URL) in Settings → Spelhubben Weather → Yr contact/UA so your User-Agent is compliant.
All three render the same UI. Use the block in the block editor, the shortcode in classic content areas, and the widget in sidebars (Appearance → Widgets). Each lets you override global defaults.
Go to Settings → Spelhubben Weather → Shortcodes. You’ll find searchable examples, one-click copy (and “copy all”), plus a live preview that renders the shortcode inside WP-admin.
If lat and lon are provided they take precedence. Otherwise the plugin geocodes the place string (e.g. place="Umeå"). Set a global default place in settings.
Use show="temp,wind,icon" (comma separated). Defaults are set in settings.
Choose layout="inline|compact|card|detailed". “Detailed” supports the multi-day forecast row.
map="1" shows a Leaflet map (OpenStreetMap). Control height with map_height="240" (px). Global defaults exist in settings.
animate="1" adds subtle UI animation. Global default is in settings.
Set forecast="daily" and days="3–10". Example: forecast="daily" days="5".
Yes. Set providers="smhi,yr,openmeteo" (order doesn’t matter). The plugin calculates a simple consensus across available providers for the displayed fields.
Pick a preset with units="metric|metric_kmh|imperial". You can override parts via temp_unit="C|F", wind_unit="ms|kmh|mph", precip_unit="mm|in", and date_format for forecast labels. All have global defaults in settings (Units & format section).
Responses are cached with WordPress transients. Change TTL (minutes) in settings. Clear via the Clear cache button on the settings page or by changing attributes (which creates a new cache key).
Yes, rendering is server-side. The map (Leaflet) requires JS.
The plugin is fully translatable. Included translations: Swedish (sv_SE), Norwegian (nb_NO), English (en_US). Strings are also available on translate.wordpress.org. Ship .pot/.po/.mo in /languages.
The plugin does not set cookies by itself. If you enable the map, Leaflet/OpenStreetMap tiles are requested client-side. Mention OSM in your privacy notice if needed.
lat/lon or a more specific place (e.g. “Uddevalla, SE”).map="1" and that your theme/container is wide/tall enough; increase map_height.[sv_vader …] is still accepted for compatibility, but deprecated and will be removed soon. Please switch to [spelhubben_weather …].
date_format).filemtime.