WPCF7_Submission::remove_uploaded_filesprivateCF7 1.0

Removes uploaded files.

Метод класса: WPCF7_Submission{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->remove_uploaded_files();

Код WPCF7_Submission::remove_uploaded_files() CF7 6.1.5

private function remove_uploaded_files() {
	$filesystem = WPCF7_Filesystem::get_instance();

	foreach ( (array) $this->uploaded_files as $file_path ) {
		foreach ( (array) $file_path as $path ) {
			if ( wpcf7_is_file_path_in_content_dir( $path ) ) {
				wpcf7_rmdir_p( $path );

				// Remove parent dir if empty.
				$filesystem->delete( dirname( $path ), false );
			}
		}
	}
}