Amazon_S3_And_CloudFront::delete_attachment PHP Method

delete_attachment() public method

Removes an attachment and intermediate image size files from S3
public delete_attachment ( integer $post_id, boolean $force_new_s3_client = false )
$post_id integer
$force_new_s3_client boolean if we are deleting in bulk, force new S3 client to cope with possible different regions
    function delete_attachment($post_id, $force_new_s3_client = false)
    {
        if (!$this->is_plugin_setup()) {
            return;
        }
        if (!($s3object = $this->get_attachment_s3_info($post_id))) {
            return;
        }
        $this->remove_attachment_files_from_s3($post_id, $s3object, true, true, true, $force_new_s3_client);
        delete_post_meta($post_id, 'amazonS3_info');
    }
Amazon_S3_And_CloudFront