@@ -34,6 +34,11 @@ wp media
3434 Imported file '/home/person/Downloads/image.png' as attachment ID 1753 and attached to post 123 as featured image.
3535 Success: Imported 1 of 1 images.
3636
37+ # Import an image from STDIN.
38+ $ curl http://example.com/image.jpg | wp media import -
39+ Imported file 'STDIN' as attachment ID 1754.
40+ Success: Imported 1 of 1 items.
41+
3742 # List all registered image sizes
3843 $ wp media image-size
3944 +---------------------------+-------+--------+-------+
@@ -113,6 +118,7 @@ wp media import <file>... [--post_id=<post_id>] [--post_name=<post_name>] [--fil
113118 Path to file or files to be imported. Supports the glob(3) capabilities of the current shell.
114119 If file is recognized as a URL (for example, with a scheme of http or ftp), the file will be
115120 downloaded to a temp file before being sideloaded.
121+ Use '-' to read file data from STDIN.
116122
117123 [--post_id=<post_id>]
118124 ID of the post to attach the imported files to.
@@ -189,6 +195,11 @@ wp media import <file>... [--post_id=<post_id>] [--post_name=<post_name>] [--fil
189195 $ wp media import http://s.wordpress.org/style/images/wp-header-logo.png --porcelain | xargs -I {} wp post list --post__in={} --field=url --post_type=attachment
190196 http://wordpress-develop.dev/wp-header-logo/
191197
198+ # Import an image from STDIN.
199+ $ curl http://example.com/image.jpg | wp media import - --title="From STDIN"
200+ Imported file 'STDIN' as attachment ID 1756.
201+ Success: Imported 1 of 1 items.
202+
192203
193204
194205### wp media prune
0 commit comments