Creates attachments from local files or URLs
Arguments
Name | Description |
---|
file | Path to file or files to be imported. Supports the glob(3) capabilities of the current shell. If file is recognized as a URL (for example, with a scheme of http or ftp), the file will be downloaded to a temp file before being sideloaded |
Options
Name | Description |
---|
--post_id <post_id> | ID of the post to attach the imported files to |
--title <title> | Attachment title (post title field) |
--caption <caption> | Caption for attachent (post excerpt field) |
--alt <alt_text> | Alt text for image (saved as post meta) |
--desc <description> | 'Description' field (post content) of attachment post |
--skip-copy | If set, media files (local only) are imported to the library but not moved on disk. File names will not be run through wp_unique_filename() with this set |
--preserve-filetime | Use the file modified time as the post published & modified dates. Remote files will always use the current time |
--featured_image | If set, set the imported image as the Featured Image of the post its attached to |
--porcelain | Output just the new attachment ID |