WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

File_Upload_Upgrader::cleanup() public WP 3.2.2

Delete 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() WP 5.5.1

wp-admin/includes/class-file-upload-upgrader.php
<?php
public function cleanup() {
	if ( $this->id ) {
		wp_delete_attachment( $this->id );

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

	return true;
}