WordPress 3.5 use `wp_get_image_editor` instead of `image_resize`
-
When I upgraded to WordPress 3.5, this plugin stopped working in my local environment. It still worked on my server, even though I have the exact same setup on them both. What’s even more interesting is that it only failed the uploads when using AJAX.
So, after some investigation, I realized that the reason this is happening is because the
image_resize
function – being used by this plugin – has been deprecated in favor ofwp_get_image_editor
.When doing an AJAX upload, the AJAX post returns JSON, which is then parsed by the JavaScript on the page. Being that I have
WP_DEBUG
turned on in my local setup, WordPress was emitting the following notice:Notice: image_resize is deprecated since version 3.5! Use wp_get_image_editor() instead. in wp-includes/functions.php on line 2824
which originates from
imsanity.php:112
.Since the notice is being echoed right there in the response, the returned data is not valid JSON, so it seems like an error.
- The topic ‘WordPress 3.5 use `wp_get_image_editor` instead of `image_resize`’ is closed to new replies.