Hi @cannon303
Unfortunately, there’s no filter hook to add custom sizes. You will have to use an action hook and retrieve the saved filename and then resize it with custom resize PHP.
You can use this action hook um_after_upload_db_meta:
add_action("um_after_upload_db_meta", "um_040921_resize_image", 10, 2 );
function um_040921_resize_image( $user_id, $field_key ){
$user_dir = UM()->uploader()->get_upload_user_base_dir( $user_id );
$filename = get_user_meta( $user_id, $field_key, true );
$file = $user_dir. DIRECTORY_SEPARATOR . $filename;
// do resize with $file
}
The above action hook is triggered when a user has uploaded the image.
Regards,
ok thanks very much for the info. I just need to work out how to create some custom resize script and then I’m there.
Hey there!
This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.
Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂
Regards,
I think a different action hook is needed here, @champsupertramp. When the um_after_upload_db_meta action fires, the new image has not yet been uploaded to the file location indicated. This only occurs once the profile is updated (saved).
I’m pretty sure the um_upload_image_result filter is a better place to achieve what is required.
Great plugin.
-
This reply was modified 4 years, 10 months ago by
1968phillip.
-
This reply was modified 4 years, 10 months ago by
1968phillip.
-
This reply was modified 4 years, 10 months ago by
1968phillip.