| 开发者 | berkux |
|---|---|
| 更新时间 | 2026年3月31日 04:24 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv3 |
| 版权网址: | 版权信息 |
[araa slot="slot_1"] or the built-in block.#GET_key# placeholders in the API URL to pass the current page's GET parameters to the remote API./wp-json/araa/v1/api/time — current server time, date, weekday, and timezone/wp-json/araa/v1/api/countdown — seconds/days until a target date (?to=YYYY-MM-DD; defaults to next New Year)/wp-json/araa/v1/api/random — random integer within a configurable range (?min=1&max=100)#GET_key# for dynamic GET parameters.items.0.score).[araa slot="slot_1"], the Gutenberg block, or a custom CSS/jQuery selector./wp-content/plugins/.If the API requires authorisation headers, use the companion plugin JSON Content Importer to create an authenticated feed and point this plugin at the result.
500 ms. Values below 500 ms are clamped to 500 ms automatically.
No. The frontend script depends on jQuery, which is bundled with WordPress.
The plugin ships with six optional REST API endpoints under the namespace araa/v1/api/. All are disabled by default and must be activated individually under Settings → Live Data Display → API.
| Endpoint | Description | Optional parameters |
|---|---|---|
| /wp-json/araa/v1/api/time | Current server time, date, weekday, and timezone | — |
| /wp-json/araa/v1/api/countdown | Countdown to a target date (days, hours, minutes, seconds) | to=YYYY-MM-DD (default: next New Year) |
| /wp-json/araa/v1/api/random | Random integer in a configurable range | min=1&max=100 |
All endpoints are publicly accessible (no authentication required) and return JSON.
Both methods let the WordPress server fetch an external JSON URL on behalf of the browser, bypassing CORS restrictions. They differ in how the browser communicates with WordPress:
admin-ajax (/wp-admin/admin-ajax.php)
/wp-json/araa/v1/geturl)
If an Error text is configured for the slot, it is displayed in place of the value. Otherwise the last successfully loaded value remains visible.
No. Settings are stored in the WordPress database and survive updates. A migration routine automatically converts the old single-slot format from versions before 1.3.0.
auto-refresh-api-ajax) and all existing settings are unchanged.[araa slot="slot_1"] shortcode renders a self-contained element with the correct ID and class. Accepts optional tag and class attributes./wp-json/araa/v1/preview).araa_ajax_nonce).wp_http_validate_url() before fetching.esc_html().ob_start() calls (one per slot) with a single buffer that applies all placeholder replacements at once./wp-json/araa/v1/api/ provide ready-to-use live data (time, countdown, random number). Each endpoint is opt-in and must be activated individually under Settings → Live Data Display → API.wp_remote_get replaces file_get_contents.wp_json_encode before using received JSON.$_SERVER['SERVER_NAME'] may be unset when running under WP-CLI.#GET_key# placeholders in the API URL.