Module — 8 operations

Media

The library: attachment details, uploads, alt text and captions, and import from a URL behind a guarded fetch.

Nothing extra to install. This module runs on core WordPress alone.

Cue 2 — first light

Before you call anything here

Note 1

media-import is the most carefully written code in the plugin. The URL is checked before the request and again after every redirect, against the address it resolved to rather than the name it was given, so a hostname pointing at a private range is refused rather than fetched.

Note 2

Alt text is a first-class field, not an afterthought: media-meta-update exists so an agent can close an accessibility gap across a library without touching anything else.

Reads — 3

What it can tell you

A read still asks WordPress for a capability against the object. There is no anonymous read anywhere in the surface.

media-get

media-read

Reads one attachment with its metadata and generated sizes

needs upload_files

Read
media-list

media-read

Lists the media library with filtering

needs upload_files

Read
image-size-list

media-read

Lists registered image sizes and their dimensions

needs read

Read
Writes — 5

What it can change

Every one of these is previewed before it runs, snapshotted before it changes anything, and verified afterwards by reading the site back. The chips are the policies the operation itself declares.

media-upload

media-write

Uploads a file from supplied bytes

needs upload_files

high risk rollback supported
media-import

media-write

Fetches a file from a URL and adds it to the library

needs upload_files

high risk rollback supported
media-meta-update

media-write

Updates alt text, caption, title, description

needs edit_post

medium risk rollback supported
media-attach

media-write

Attaches an existing item to a post

needs edit_post

medium risk rollback supported
media-resize

media-write

Brings an oversized image within a width and height you name, keeping the original file

needs edit_post + upload_files

high risk rollback supported
Cue 5 — day

Keep reading