wp-cli / media-command

Imports files as attachments, regenerates thumbnails, or lists registered image sizes.
MIT License
44 stars 41 forks source link

Option to override filename while importing media #186

Closed sandeshjangam closed 1 year ago

sandeshjangam commented 1 year ago

Feature Request

Describe your use case and the problem you are facing

Import media from URL

wp media import https://images.pexels.com/photos/708587/pexels-photo-708587.jpeg --title=abc --caption=caption --alt=alt

After import URL

http://test.local/wp-content/uploads/2023/11/pexels-photo-708587.jpeg

No option to override a file name pexels-photo-708587.jpeg

Describe the solution you'd like We can introduce the new option slug

--slug=abcd 

After this change, after import URL will be After import URL

http://test.local/wp-content/uploads/2023/11/abcd.jpeg
danielbachhuber commented 1 year ago

Thanks for the suggestion, @sandeshjangam !

I'm open to this. Feel free to submit a pull request, if you'd like. Here is some guidance on our pull request best practices.

sandeshjangam commented 1 year ago

@danielbachhuber Thanks. I will create a PR.

danielbachhuber commented 1 year ago

🔨