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?
Thanks
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: