WordPress plugin using wp.media to crop images
-
Im using this function in my new WordPress plugin development, this works ok, using WordPress Media Uploader for image upload, but I need to use a predefined crop functionality to crop the image after upload and I don’t know how do it.
function wilson_newsletter_media_library(big_parent){ var frame_uploader, datos_imagen; if ( undefined !== frame_uploader ) { frame_uploader.open(); return; } frame_uploader = wp.media.frames.frame_uploader = wp.media({ title: "Insert Media", button: { text: "Aceptar" }, multiple: false }); frame_uploader.on( 'select', function() { datos_imagen = frame_uploader.state().get( 'selection' ).first().toJSON(); big_parent.children('img').attr("src", datos_imagen.url); }); frame_uploader.open(); }
Can I use “WP_Customize_Cropped_Image_Control” in some way to crop the image?
I really apreciate any help.The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WordPress plugin using wp.media to crop images’ is closed to new replies.