All media abilities
All upload abilities require the
upload_files capability. Make sure the WordPress user connected to your AI client has this capability before calling any upload ability.Key ability examples
maxi/upload-image
Upload an image to the media library from a remote URL, or send the file content as a base64 string.- From URL
- From base64
maxi/upload-attachment
Upload any file type — PDFs, documents, zip archives, and more. Use this when you need to upload something that isn’t an image.maxi/upload-image, you can also pass filename + content_base64 instead of a url.
maxi/set-featured-image
Set the featured image on any post, page, or custom post type by providing the post ID and the attachment ID of an existing media item.attachment_id to null.
maxi/regenerate-thumbnails
Regenerate all registered image sizes for an attachment. Use this after you add new image size registrations to your theme, or after you change an image in the media library.Attaching and detaching media
Usemaxi/attach-media to associate an existing media item with a parent post, and maxi/detach-media to remove that association and return the item to the unattached state. These operations do not delete the file from the media library.