junaidbhura / fly-dynamic-image-resizer

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

wp_get_attachment_image_src compatibility #5

Closed jmarceli closed 7 years ago

jmarceli commented 7 years ago

Maybe it is not so bad idea to make fly_get_attachment_image_src "backward" compatible with wp_get_attachment_image_src. What I mean is adding to the outputed array keys similar to that available in Wordpress core function. So the output of fly_get_attachment_image_src would be for example:

array(
  0 => 'http://....',
  'src' => 'http://....',
  1 => '100',
  'width' => '100',
  2 => '200',
  'height' => '200',
);

With this modification conversion from traditional wp_get_attachment_image_src to fly_get_attachment_image_src (for an existing theme) would be much easier. Do you see any drawbacks?

I would be happy to make a PR.

junaidbhura commented 7 years ago

Hey @jmarceli the idea is to keep this functionality separate from the main WordPress functionality, so that both can be used in parallel. I want to keep this plugin really simple and similar to the core functions and their output.