WP Extra File Types - Version 0.1

Version Description

Download this release

Release Info

Developer davide.airaghi
Plugin Icon 128x128 WP Extra File Types
Version 0.1
Comparing to
See all releases

Version 0.1

Files changed (2) hide show
  1. readme.txt +34 -0
  2. wp-extra-file-types.php +32 -0
readme.txt ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP Extra File Types ===
2
+ Contributors: davide.airaghi
3
+ Tags: auto update, plugin, theme
4
+ Requires at least: 4.0
5
+ Tested up to: 4.1
6
+ Stable tag: 0.1
7
+ License: GPLv2 or later
8
+ License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ Plugin to let you extend the list of allowed file types to the ones
11
+ supported by the Wordpress Media Library.
12
+
13
+
14
+ == Description ==
15
+ This plugin add some file types to the default list of file extensions
16
+ supported by the Media Library upload procedure.
17
+
18
+ File Types added:
19
+ * 7z
20
+ * gz
21
+ * bz2
22
+ * tgz
23
+ * txz
24
+ * txt
25
+ * xz
26
+ * zip
27
+
28
+ == Installation ==
29
+ 1. Create the directory wp-extra-file-types in your '/wp-content/plugins/' directory
30
+ 2. Upload all the plugin's file to the newly created directory
31
+ 3. Activate the plugin through the 'Plugins' menu in WordPress
32
+
33
+ == Changelog ==
34
+ 0.1 - first release
wp-extra-file-types.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: WP Extra File Types
4
+ * Description: Plugin to let you extend the list of allowed file types to the ones supported by the Wordpress Media Library.
5
+ * Plugin URI: http://www.airaghi.net/en/2015/01/02/wordpress-custom-mime-types/
6
+ * Version: 0.1
7
+ * Author: Davide Airaghi
8
+ * Author URI: http://www.airaghi.net
9
+ * License: GPLv2 or later
10
+ */
11
+
12
+ defined('ABSPATH') or die("No script kiddies please!");
13
+
14
+ add_filter('upload_mimes','add_extra_mime_types');
15
+
16
+ function add_extra_mime_types($mimes){
17
+ return array_merge($mimes,array (
18
+ // text
19
+ 'txt' => 'text/plain',
20
+ // compressed
21
+ '7z' => 'application/x-7z-compressed',
22
+ 'bz2' => 'application/x-bzip2',
23
+ 'gz' => 'application/x-gzip',
24
+ 'tgz' => 'application/x-gzip',
25
+ 'txz' => 'application/x-xz',
26
+ 'xz' => 'application/x-xz',
27
+ 'zip' => 'application/zip'
28
+ ));
29
+ }
30
+
31
+
32
+ ?>