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