File_Upload_Upgrader::cleanup()
Deletes the attachment/uploaded file.
Метод класса: File_Upload_Upgrader{}
Хуков нет.
Возвращает
true|false
. Whether the cleanup was successful.
Использование
$File_Upload_Upgrader = new File_Upload_Upgrader(); $File_Upload_Upgrader->cleanup();
Список изменений
С версии 3.2.2 | Введена. |
Код File_Upload_Upgrader::cleanup() File Upload Upgrader::cleanup WP 6.6.2
public function cleanup() { if ( $this->id ) { wp_delete_attachment( $this->id ); } elseif ( file_exists( $this->package ) ) { return @unlink( $this->package ); } return true; }