do this code can work for me?
add_action('rwmb_after_save_field', function ($null, $field, $new, $old, $object_id) {
// Only process 'image_advanced' fields
if ($field['id'] === 'your_meta_field_id' && !empty($new)) {
foreach ((array) $new as $image_id) {
// Check if the image exists
if (get_post_mime_type($image_id) === 'image/jpeg' || get_post_mime_type($image_id) === 'image/png' || get_post_mime_type($image_id) === 'image/webp') {
// Generate WordPress standard sizes (thumbnail, medium, large)
wp_create_image_subsizes(get_attached_file($image_id), $image_id);
}
}
}
}, 10, 4);