• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

QUESTION Auto-optimization uploading images using MediaPress

ma.ja

New member
Messages
1
Likes
0
Points
1
#1
Hi,

I'm using MediaPress Plugin to allow users to upload images. The Images get stored in wp-content/uploads/mediapress folder but doesn't get optimized during upload. I have to manually run the optimization with robin image optimizer. Is there a possibility to auto optimize the images during upload like when i upload images directly in wordpress media libary. Is there any hook i can use like in the examples below?


PHP:
add_action( 'init', 'mpp_custom_robin_image_optimizer' );



function mpp_custom_robin_image_optimizer() {

    if( function_exists( 'jr_uploadresize_resize' )

        add_action( 'mpp_handle_upload', 'jr_uploadresize_resize' );

}
PHP:
add_action( 'init', 'mpp_custom_robin_image_optimizer' );



function mpp_custom_robin_image_optimizer() {

    if( function_exists( 'ewww_image_optimizer_handle_upload' ) ) {

        add_action( 'mpp_handle_upload', 'ewww_image_optimizer_handle_upload' );

        add_filter( 'mpp_generate_attachment_metadata', 'ewww_image_optimizer_resize_from_meta_data', 15, 2 );

    }

}

Thanks
 
Last edited:

Temyk

Developer & Support
Staff member
Messages
608
Likes
31
Points
28
#2
Hello.

There is no such possibility and there are no hooks for this either