File_Upload_Upgrader::cleanup
Deletes the attachment/uploaded file.
Method of the class: File_Upload_Upgrader{}
No Hooks.
Returns
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. |
File_Upload_Upgrader::cleanup() File Upload Upgrader::cleanup code WP 7.0
public function cleanup() {
if ( $this->id ) {
wp_delete_attachment( $this->id );
} elseif ( file_exists( $this->package ) ) {
return @unlink( $this->package );
}
return true;
}