File_Upload_Upgrader::cleanup(): bool

In this article

Deletes the attachment/uploaded file.

Return

bool Whether the cleanup was successful.

Source

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

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

	return true;
}

Changelog

VersionDescription
3.2.2Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.