0

I want to be able to call the Media Library image editor from my plugin. From what I can see looking at the console that it is passing a URL like so http://example.com/wp-admin/admin.php?action=image-editor&_ajax_nonce=aa3dbd63c2&postid=551&do=open. But I have not been able to make this work. Does anyone know how it would be done?

1 Answer 1

1

If the edit link to your image is:

http://example.tld/wp-admin/post.php?post=551&action=edit

then the link to the image editor for that image is:

http://example.tld/wp-admin/post.php?post=551&action=edit&image-editor

The $_GET['image-editor'] is checked for in the edit_form_image_editor() function.

PS: I first noticed this trick, when testing this avatar plugin recently (I'm not related to that plugin)

1
  • Yes, this works. Thank you. Now I need to figure out how to add a link to the image editor to get back to the plugin page. That is another question I'll post.
    – AlanP
    Commented Nov 4, 2016 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.