Upload::upload_file( array $file )

Description #

Upload a file.

Parameters #

  • $file
    array (Required) File array.

Changelog #

VersionDescription
4.1.5Fixed: custom mimes are not working.
4.1.0Introduced.

Source #

File: lib/form/class-upload.php

	private function upload_file( $file ) {
		$id = $this->upload( $file );

		if ( is_wp_error( $id ) ) {
			$this->add_error( $id->get_error_code(), $id->get_error_message() );
		} else {
			$this->uploaded_files[ sanitize_file_name( $file['name'] ) ] = $id;
		}
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment