Upload media
wp_upload_mediaUploads a file to the WordPress media library from a local path or public URL, returning the media ID for use as a featured image or in content.
Instructions
Upload a file to the media library from a local path or a public URL, and get back the media ID to use as a featured image or in content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | Configured site name. Omit to use the default site. | |
| title | No | ||
| source | Yes | Absolute local file path, or an http(s) URL to fetch and re-upload. | |
| caption | No | ||
| alt_text | No | Alt text — set this for images. | |
| filename | No | Override the stored filename. |