junaidbhura / fly-dynamic-image-resizer

Fly Dynamic Image Resizer plugin for WordPress
https://wordpress.org/plugins/fly-dynamic-image-resizer/
MIT License
162 stars 26 forks source link

Possible to pass path instead of attachment_id #12

Closed Jelmerkeij closed 7 years ago

Jelmerkeij commented 7 years ago

Hi junaidbhura,

Thank you for this cool plugin. I was wondering if it is also possible to pass a path to fly_get_attachment_image_src() instead of only the attachment_id. If this would be possible it would make life much easier for custom theme builders like myself. Please let me know your thoughts.

junaidbhura commented 7 years ago

Hey @Jelmerkeij I'm really glad you find this plugin useful!

The "right" (WordPress) way to get images is based on image / attachment IDs, rather than the path. That's why you don't see any core functions that support this. I'd strongly recommend you start using IDs in your themes rather than paths.

Because of this, I think it's best to not have this functionality in this plugin. Sorry about that!