Support » Plugin: Advanced Custom Fields: Image Aspect Ratio Crop Field » Which Action Hook triggers IARC?

  • David Bee



    So on our site we need to allow people to upload images from their computers and then crop them to a 1:1 aspect ratio. Your plugin works like a charm. However, for security reasons, I can’t give my users access to the Media Library. Sadly, the default WP Media Uploader includes this, so it won’t work. I’ve been looking at other solutions, and ultimately what I may do is create my own WordPress plugin for ACF that uses Dropzone.js. That way we get media uploads (including drag and drop integration) without disclosing the WP Media Library to users. I’d love to then integrate this with your plugin. If I do decide to venture down this path, what action hook does your ACF Image Aspect Ratio Crop listen for to trigger the modal and everything else?

    Let me know your thoughts on the above and if you have any ideas/suggestions on the best way for us to integrate the two elements together.


Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author joppuyo



    I don’t think it would be easy to integrate this plugin in a workflow like that at all. There isn’t a simple filter you can use to initiate the cropping.

    I think it would be easier if you fork the plugin and modify it to your needs.

    Front end image crop is a feature that has been often requested but it’s still on my todo list. If you manage to get it working I would appreciate creating a pull request on GitHub so other people can enjoy this feature.

    • This reply was modified 1 year ago by joppuyo.
    Thread Starter David Bee



    So I don’t think I was clear in my previous message as I think we misunderstood each other.

    Upon looking through the plugin’s code, I can see that your input-script.js eventually triggers not only the Advanced Custom Fields WordPress Media upload modal, but ultimately the openModal() function, which handles the rest of ACF Image Aspect Ratio Crop’s actions (opening the modal, cropping the file, updating the attachment, etc).

    So in theory, wouldn’t work if I were to create a dropzone field which on success triggers the same openModal() function?


    PS- and of course I’d be happy to do a pull request so that this could get incorporated into the plugin.

    • This reply was modified 11 months, 3 weeks ago by David Bee.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Which Action Hook triggers IARC?’ is closed to new replies.