Skip to content

Commit 0272327

Browse files
Regenerate README file (#243)
Co-authored-by: Alain Schlesser <alain.schlesser@gmail.com>
1 parent 5e4e696 commit 0272327

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ wp media
5252
1/1 Fixing orientation for "Portrait_6" (ID 63).
5353
Success: Fixed 1 of 1 images.
5454

55+
# Remove all generated thumbnails, without confirmation.
56+
$ wp media prune --yes
57+
Found 3 images to prune.
58+
1/3 Pruned thumbnails for "Sydney Harbor Bridge" (ID 760).
59+
2/3 Pruned thumbnails for "Boardwalk" (ID 757).
60+
3/3 Pruned thumbnails for "Sunburst Over River" (ID 756).
61+
Success: Pruned 3 of 3 images.
62+
5563

5664

5765
### wp media fix-orientation
@@ -183,6 +191,62 @@ wp media import <file>... [--post_id=<post_id>] [--post_name=<post_name>] [--fil
183191

184192

185193

194+
### wp media prune
195+
196+
Removes all generated image files for one or more attachments.
197+
198+
~~~
199+
wp media prune [<attachment-id>...] [--image_size=<image_size>...] [--remove-abandoned] [--yes]
200+
~~~
201+
202+
Generated image files for registered sizes can be recreated with
203+
`wp media regenerate`. Thumbnails for image sizes that are no longer
204+
registered are kept by default because they cannot be regenerated; use
205+
`--remove-abandoned` to remove them as well.
206+
207+
**OPTIONS**
208+
209+
[<attachment-id>...]
210+
One or more IDs of the attachments to prune.
211+
212+
[--image_size=<image_size>...]
213+
Name of the image size to remove. Repeat the flag to specify multiple. Only thumbnails of specified image size(s) will be removed, thumbnails of other image sizes will not.
214+
215+
[--remove-abandoned]
216+
Also remove thumbnails for image sizes that are no longer registered.
217+
218+
[--yes]
219+
Answer yes to the confirmation message. Confirmation only shows when no IDs passed as arguments.
220+
221+
**EXAMPLES**
222+
223+
# Remove all generated thumbnails for all images, without confirmation.
224+
$ wp media prune --yes
225+
Found 3 images to prune.
226+
1/3 Pruned thumbnails for "Sydney Harbor Bridge" (ID 760).
227+
2/3 Pruned thumbnails for "Boardwalk" (ID 757).
228+
3/3 Pruned thumbnails for "Sunburst Over River" (ID 756).
229+
Success: Pruned 3 of 3 images.
230+
231+
# Remove only the "large" thumbnails for all images.
232+
$ wp media prune --image_size=large
233+
Do you really want to prune the "large" image size for all images? [y/n] y
234+
Found 3 images to prune.
235+
1/3 Pruned thumbnails for "Sydney Harbor Bridge" (ID 760).
236+
2/3 Pruned thumbnails for "Boardwalk" (ID 757).
237+
3/3 Pruned thumbnails for "Sunburst Over River" (ID 756).
238+
Success: Pruned 3 of 3 images.
239+
240+
# Remove all thumbnails including those for unregistered sizes.
241+
$ wp media prune --remove-abandoned --yes
242+
Found 3 images to prune.
243+
1/3 Pruned thumbnails for "Sydney Harbor Bridge" (ID 760).
244+
2/3 Pruned thumbnails for "Boardwalk" (ID 757).
245+
3/3 Pruned thumbnails for "Sunburst Over River" (ID 756).
246+
Success: Pruned 3 of 3 images.
247+
248+
249+
186250
### wp media regenerate
187251

188252
Regenerates thumbnails for one or more attachments.
@@ -337,6 +401,10 @@ Want to contribute a new feature? Please first [open a new issue](https://github
337401

338402
Once you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See "[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)" for details specific to working on this package locally.
339403

404+
### License
405+
406+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
407+
340408
## Support
341409

342410
GitHub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support

0 commit comments

Comments
 (0)