| 开发者 | obenland |
|---|---|
| 更新时间 | 2026年5月7日 08:42 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
strava-embeds.com; for short share links (strava.app.link/…), the site server makes a HEAD request to Strava to resolve the canonical URL. See the External services section below for full details.
Features:
strava.com/activities/…, strava.com/routes/…, strava.com/segments/…), short share links (strava.app.link/…), and the share-dialog embed snippet (with token, for non-public activities)referrerpolicy=origin/wp-content/plugins/block-for-strava/, or install directly from the WordPress Plugins screen.It depends on the resource type. Public ("Everyone") activities, routes, and segments embed from a URL alone. Followers-only and private activities embed via Strava's share-dialog snippet — paste the <div class="strava-embed-placeholder" …>…</div> block (with its data-token share token) on its own line and the Strava block picks it up. The block round-trips a share token attribute for any resource type, so if Strava ever exposes a share-dialog snippet for a non-public route or segment, the same paste flow will carry that token through; in practice today Strava's share-with-token UI is on activities only, so non-public routes and segments can't be embedded yet.
Visitors don't need any account or API key — they just see the embedded iframe. The block uses Strava's public embed feature, which doesn't require API access on this side. To embed a followers-only or private activity, the post author needs a logged-in Strava session to open Share → Embed in Strava's UI and copy the snippet (the snippet carries the per-share token Strava requires for those embeds). Authors embedding only public Strava URLs don't need an account either.
Full canonical URLs — https://www.strava.com/activities/12345678, https://www.strava.com/routes/12345, https://www.strava.com/segments/67890 — and Strava short share links (https://strava.app.link/…). The share-dialog embed snippet (the <div class="strava-embed-placeholder" …>…</div> block from Strava's Share → Embed dialog) is also supported and is the path to use for non-public activities, since it carries the per-share token Strava requires for those embeds.
Strava does not publish a public oEmbed endpoint. The block has a PHP render callback that generates the iframe markup deterministically from the saved URL and route attributes. The plugin runs no admin pages, options screens, or scheduled tasks. It does register a single editor-only REST route (/wp-json/block-for-strava/v1/embed-status) that the block's edit component calls to determine whether a saved activity URL needs a share token — the route is gated on edit_posts capability and is not used by the front end.