junaidbhura / auto-cloudinary

Super simple Cloudinary auto-upload implementation for WordPress.
https://wordpress.org/plugins/auto-cloudinary/
MIT License
40 stars 9 forks source link

Allow named transformation #47

Closed monecchi closed 2 years ago

monecchi commented 2 years ago

Hi there. Thanks for this awesome plugin, it's a life saver!

As long as Cloudinary allows to create named transformations, I was wondering if would it be viable to include the functionality on a next plugin update? Here's their docs: https://cloudinary.com/documentation/named_transformations_tutorial,

By hitting the image url as such https://res.cloudinary.com/demo/image/upload/t_global/Model_woman.jpg, where global is the transformation name, we could easily skip all the transformation arguments. Something as follows:

$image_args = array(
    'transform' => array( 
        '_t' => 'site__header_image_wide__low',
    )
);
monecchi commented 2 years ago

Sorry, just read the docs again under Functions section and I found out there's a named_transformation argument available. I'll just give it a try and see how that works. Thanks!

monecchi commented 2 years ago

I can confirm it works! Thanks!

$image_args = array(
    'transform' => array( 
        'named_transformation' => 'site__header_image_wide__low',
    )
);
junaidbhura commented 2 years ago

thanks @monecchi - closing this issue!