HI @vayu ,
You could try to disable the auto compression by using the following action
remove_action( 'wp_async_wp_generate_attachment_metadata', array( '\Smush\Core\Modules\Smush', 'wp_smush_handle_async' ) );
So, maybe using the remove_action along with the mentioned ACF function might help. It’s something you’ll have to test and see how it goes.
I hope this helps in moving forward. Please do let us know how that goes.
Kind Regards,
Nithin
Thanks a lot for your suggestion. Unfortunately, it did not work. Any other ideas? 🙂
Hi @vayu
Sorry to hear it didn’t work.
I pinged our developers to verify if we have any different hook for this.
We will update once hearing from the developers.
Best Regards
Patrick Freitas
Hello @vayu
You can use something similar to the following snippet:
add_filter( 'wp_smush_image', function( $should_smush ){
if( $should_smush && ! empty( $_POST['form_id'] ) && $_POST['form_id'] == 671 ){
$should_smush = false;
}
return $should_smush;
} );
Keep in mind that we restrict this to one specific form, so we do not affect other forms on the site, so you might need to edit the followings:
$_POST['form_id']
$_POST['form_id'] == 671
to point to your form, as these are for an example using Forminator like this:
https://share.getcloudapp.com/p9ubyxRD/
Thank you,
Dimitris
Hi @vayu
I hope you are doing well and safe!
We haven’t heard from you in a while, I’ll mark this thread as resolved.
Feel free to let us know if you have any additional question or problem.
Best Regards
Patrick Freitas
I have not been able to test your last code, because we disabled the Smush plugin because of these issues. I have not had time and the client has not requested looking back into this.
Thanks a lot for your help though. 🙂