WordPress at Your Fingertips
function is not described

File_Upload_Upgrader::cleanup() public WP 3.2.2

Delete the attachment/uploaded file.

{} It's a method of the class: File_Upload_Upgrader{}

No Hooks.

Return

true|false. Whether the cleanup was successful.

Usage

$File_Upload_Upgrader = new File_Upload_Upgrader();
$File_Upload_Upgrader->cleanup();

Changelog

Since 3.2.2 Introduced.

Code of File_Upload_Upgrader::cleanup() WP 5.8.2

public function cleanup() {
	if ( $this->id ) {
		wp_delete_attachment( $this->id );

	} elseif ( file_exists( $this->package ) ) {
		return @unlink( $this->package );
	}

	return true;
}