public function update_image_thumbs($meta_id, $post_id, $key, $value) { if ($key != '_inserts_data') { return; } $inserts = maybe_unserialize($value); if (!is_array($inserts)) { return; } foreach ($inserts as $id => $img) { if (isset($img['imageThumb']) && $img['isLocal'] != 'false') { //We got an image $image_path = $this->get_image_path($img['imageThumb']['src']); //If the file doesn't exits, let's create it if (!file_exists($image_path)) { // Get image data $imageData = Upfront_Uimage_Server::calculate_image_resize_data($img['imageThumb'], $img['imageFull']); // Add the full size image path $imageData['image_path'] = $this->get_image_path($img['imageFull']['src']); $imageData['skip_random_filename'] = true; Upfront_Uimage_Server::resize_image($imageData); } } } }