Skip to content

Allow multiple image_sizes for regeneration #216

@apermo

Description

@apermo

Feature Request

Describe your use case and the problem you are facing

I had the case that I needed to regenerate 2 image sizes, or rather 1 newly added and 1 existing image size.
To solve this I had to run wp media regenerate --image_size=new_image_size and wp media regenerate --image_size=updated_image_size

Since I am talking about a multisite with 6 sites that we want to update, and each has at least 10k attachments, running the two commands does not seem to be efficient.

Describe the solution you'd like

I would love to be able to run either:

Enhancing the existing --image_size to allow single or multiple image sizes)
wp media regenerate --image_size=new_image_size,updated_image_size

or

Introducing a new --image_sizes that will accept multiple, in order to keep the grammar correct.
wp media regenerate --image_sizes=new_image_size,updated_image_size

Note: I'm happy to propose a PR, I'd just need a heads up if you think it's a good addition and which of the two suggested routes to take. I might need help updating the related unit tests.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions