getThumbnailPath()) and $force) unlink($post->getThumbnailPath()); if (!file_exists($post->getThumbnailPath())) $post->generateThumbnail(); } echo 'Don\'t forget to check access rights.' . PHP_EOL;