
外掛標籤
開發者團隊
原文外掛簡介
Show live weather on any page or template with a native Gutenberg block—no iframe embeds and no API keys in the browser.
4WP Weather fetches current conditions through WordPress (REST + server cache), stores your OpenWeatherMap key safely in the admin, and renders a clean widget you can style with block colors, typography, and spacing.
A plugin by 4wp.dev.
Perfect for
A sidebar or footer weather snippet with temperature, humidity, wind, and more
Landing pages that need local conditions without a third-party widget
Block themes and Full Site Editing layouts
Editors who want icon + text labels per field, editable inline in the block
How it works
Install and activate 4WP Weather.
Open 4WP Weather in the admin menu → Providers, add your OpenWeatherMap API key, and save.
Insert the 4WP Weather block in the editor.
Pick a widget template (Small, Compact, or Advanced) and style (Dark or White).
Choose which parameters to show and how each label appears (icon, icon + text, or text).
Publish—the block loads data on the front end via your server.
Key features
Gutenberg block with block supports: background/text colors, typography, spacing, border, wide/full align
Widget templates — Small (location + temperature), Compact (core fields), Advanced (all nine parameters)
Per-field presentation — built-in weather icons, icon + text, text-only, or custom SVG from the Media Library
Editable labels — customize parameter names inline in the editor (Text and Icon + text modes)
OpenWeatherMap provider (live); additional providers registered for future releases
Visitor location — optional browser geolocation (automatic or button prompt) with coordinate fallback
Location search — optional city/place search on the front end
React admin — Providers, Settings (default template), and Documentation tabs
Server-side requests with transient cache; API key never exposed to visitors
Optional JSON-LD structured data (Observation) for SEO
Optional admin bar weather preview for administrators
WP-CLI: wp forwp-weather flush-cache
Privacy
The API key is stored as a WordPress option and is not exposed to front-end HTML or JavaScript. The block calls forwp-weather/v1/weather; PHP performs the remote request. See External services below.
4WP is our project brand; the letters “WP” appear only as part of that brand name, not as a reference to WordPress. This plugin is not affiliated with, endorsed, or sponsored by WordPress.
Source code: github.com/4wpdev/4wp-weather
External services
This plugin connects to the OpenWeatherMap Current Weather API to fetch conditions shown in the weather block, admin live preview, and optional JSON-LD.
When a visitor loads a page with the block (or when an administrator uses the live preview), WordPress sends a server-side HTTPS request to https://api.openweathermap.org/data/2.5/weather. The request includes:
Your stored API key (appid query parameter), configured in the admin.
Geographic coordinates (lat, lon) from block settings, browser geolocation when the visitor allows it, or a default location you configure.
Or a city name (q) when location search is used.
This plugin does not send visitor IP addresses in the API request. OpenWeatherMap may log requests according to their own policies. Responses are cached on your server (WordPress transients) to reduce repeat API calls.
This service is provided by OpenWeather Ltd. (OpenWeatherMap):
Terms of use: https://openweathermap.org/terms
Privacy policy: https://openweather.co.uk/privacy-policy
