Media::get_type_dropdown_options()

Gets the available dropdown options to specify the file type.

Description

See also

Return

(array) Array of <code>$value => $label</code> pairs.

Source

File: src/db-objects/elements/element-types/base/media.php

	protected function get_type_dropdown_options() {
		$media_types = array(
			'type_image'       => __( 'Images (.jpg, .png, ...)', 'torro-forms' ),
			'type_audio'       => __( 'Audio files (.wav, .mp3, ...)', 'torro-forms' ),
			'type_video'       => __( 'Video files (.avi, .mpeg, ...)', 'torro-forms' ),
			'type_document'    => __( 'Documents (.doc, .pdf, ...)', 'torro-forms' ),
			'type_spreadsheet' => __( 'Spreadsheets (.xls, .numbers, ...)', 'torro-forms' ),
			'type_interactive' => __( 'Interactive (.ppt, .swf, ...)', 'torro-forms' ),
			'type_text'        => __( 'Text files (.txt, .csv, ...)', 'torro-forms' ),
			'type_archive'     => __( 'File archives (.zip, .rar, ...)', 'torro-forms' ),
			'type_code'        => __( 'Source code (.html, .js, ...)', 'torro-forms' ),
		);

		$file_extensions = array_keys( $this->get_file_mime_types() );

		$media_sub_types = array_combine( $file_extensions, array_map( function( $extension ) {
			return '.' . $extension;
		}, $file_extensions ) );

		return array_merge( array( 'any' => __( 'Any', 'torro-forms' ) ), $media_types, $media_sub_types );
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.