wp_get_image_editor

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

wp_get_image_editor

Luke Bryan
Greetings all,

I had noticed something odd in the documentation for wp_get_image_editor -
while it says "This function is the main function that you use when you
want to edit an image by url", the example doesn't give a url as the
parameter. Why is a url expected instead of a local file path?

It seems odd that it expects url and fetches them, as local file is more
efficient and less likely to be blocked. Any specific reason it is built
this way?

Best regards,
Luke
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: wp_get_image_editor

J.D. Grimes
Don't believe a word the codex tells you. If you want the truth, go to the source. (I'm exaggerating slightly. ;-)

The docs for the function don't even mention the word URL: https://developer.wordpress.org/reference/functions/wp_get_image_editor/

The name of the parameter is even $path. So of course it accepts a local file path. But it does accept URLs too: https://developer.wordpress.org/reference/classes/wp_image_editor_gd/load/

Feel free to update the codex to clarify this. :-)

-J.D.

> On Jun 12, 2015, at 6:37 PM, Luke Bryan <[hidden email]> wrote:
>
> Greetings all,
>
> I had noticed something odd in the documentation for wp_get_image_editor -
> while it says "This function is the main function that you use when you
> want to edit an image by url", the example doesn't give a url as the
> parameter. Why is a url expected instead of a local file path?
>
> It seems odd that it expects url and fetches them, as local file is more
> efficient and less likely to be blocked. Any specific reason it is built
> this way?
>
> Best regards,
> Luke
> _______________________________________________
> wp-hackers mailing list
> [hidden email]
> http://lists.automattic.com/mailman/listinfo/wp-hackers

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers