Skip to content

feat: normalised media and a CDN for the uploads (0.5) - #13

Merged
ogorzalka merged 1 commit into
mainfrom
feat/0.5-media
Nov 24, 2026
Merged

ogorzalka merged 1 commit into
mainfrom
feat/0.5-media

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Third slice of 0.5.

  • One shape: GET /headless/v1/media/{id} gives an image, a video, a sound or a document with the same keys (url, sizes, srcset, alt, caption, width, height, filesize, duration, modified). The focal point is the one set with pollora/media (_pollora_focal_point, and its pollora/media/focal_point filter), null without it.
  • Featured image in the same request: field headless_featured_media on posts, computed only when _fields names it (WordPress computes every registered field otherwise).
  • CDN: media.cdn_url swaps the uploads address for the CDN's in a file's address, srcset and the HTML of the content; the administration keeps WordPress addresses.
  • Visibility: a file of the library is public; one attached to a post follows that post (read_post is no use on an attachment's 'inherit' status).
  • Unit and integration tests (real attachment metadata, real REST, real filters).

- NormalizedMedia: a file in one shape whatever its kind (url, sizes, srcset, alt, caption, dimensions, duration, focal point from pollora/media)
- GET /wp-json/headless/v1/media/{id}; headless_featured_media field of posts, computed only when _fields names it (OptInField)
- MediaUrls and MediaCdn: the uploads served from a CDN in the address, srcset and content, not in the administration
- A file attached to a draft is visible to those who can see the draft
@ogorzalka ogorzalka added the api-change The public surface (hooks, config keys, commands) changes label Nov 24, 2026
@ogorzalka
ogorzalka merged commit 92047e4 into main Nov 24, 2026
11 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change The public surface (hooks, config keys, commands) changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant