wp_media_upload
Upload files to the WordPress media library using a URL or base64 data, with optional metadata for title, alt text, caption, and post attachment.
Instructions
Upload a file to the WordPress media library. Provide EITHER url (the server will fetch the URL and forward the bytes) OR data (a base64-encoded string) with filename and mime_type. Optional metadata: title, alt_text, caption, description, post (attach to a post). Max 25 MB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| data | No | ||
| post | No | ||
| title | No | ||
| caption | No | ||
| alt_text | No | ||
| filename | No | ||
| mime_type | No | ||
| description | No |