Version Description
- Fixed the help message in the administration menu.
- If the added mime type does not work, please turn off the mime type setting or deactivate other mime type plugins.
Download this release
Release Info
Developer | kimipooh |
Plugin | WP Add Mime Types |
Version | 2.0.3 |
Comparing to | |
See all releases |
Code changes from version 2.0.2 to 2.0.3
- includes/admin.php +2 -3
- includes/network-admin.php +1 -1
- readme.txt +11 -2
- wp-add-mime-types.php +4 -9
includes/admin.php
CHANGED
@@ -63,7 +63,7 @@ foreach ($mime_type_values as $line){
|
|
63 |
if(count($line_value) != 2) continue;
|
64 |
$mimes[trim($line_value[0])] = trim($line_value[1]);
|
65 |
}
|
66 |
-
|
67 |
// List view of the allowed mime types including the addition (red color) in the admin settings.
|
68 |
foreach($allowed_mime_values as $type=>$value){
|
69 |
if(isset($mimes)){
|
@@ -74,7 +74,6 @@ foreach($allowed_mime_values as $type=>$value){
|
|
74 |
break;
|
75 |
}
|
76 |
}
|
77 |
-
|
78 |
echo "<tr><td$add_mime_type_check>$type</td><td$add_mime_type_check>=</td><td$add_mime_type_check>$value</td></tr>\n";
|
79 |
}else
|
80 |
echo "<tr><td>$type</td><td>=</td><td>$value</td></tr>\n";
|
@@ -87,7 +86,7 @@ foreach($allowed_mime_values as $type=>$value){
|
|
87 |
|
88 |
<fieldset style="border:1px solid #777777; width: 750px; padding-left: 6px;">
|
89 |
<legend><h3><?php _e('Add Values','wp-add-mime-types'); ?></h3></legend>
|
90 |
-
<p><?php _e('* About the mime type value for the file extension, please search "mime type [file extension name] using a search engine.<br/>
|
91 |
<p><span style="color:red;"><?php if(is_multisite() && is_plugin_active_for_network($plugin_basename)) _e('* The site administrator cannot add the value for mime type because the multisite is enabled. <br/>Please contact the multisite administrator if you would like to add the value.','wp-add-mime-types'); ?></span></p>
|
92 |
|
93 |
<?php // If the permission is not allowed, the user can only read the setting. ?>
|
63 |
if(count($line_value) != 2) continue;
|
64 |
$mimes[trim($line_value[0])] = trim($line_value[1]);
|
65 |
}
|
66 |
+
|
67 |
// List view of the allowed mime types including the addition (red color) in the admin settings.
|
68 |
foreach($allowed_mime_values as $type=>$value){
|
69 |
if(isset($mimes)){
|
74 |
break;
|
75 |
}
|
76 |
}
|
|
|
77 |
echo "<tr><td$add_mime_type_check>$type</td><td$add_mime_type_check>=</td><td$add_mime_type_check>$value</td></tr>\n";
|
78 |
}else
|
79 |
echo "<tr><td>$type</td><td>=</td><td>$value</td></tr>\n";
|
86 |
|
87 |
<fieldset style="border:1px solid #777777; width: 750px; padding-left: 6px;">
|
88 |
<legend><h3><?php _e('Add Values','wp-add-mime-types'); ?></h3></legend>
|
89 |
+
<p><?php _e('* About the mime type value for the file extension, please search "mime type [file extension name] using a search engine.<br/>Ex. epub = application/epub+zip<br/>Reference: <a href="http://www.iana.org/assignments/media-types/media-types.xhtml" target="_blank">Media Types on the Internet Assigned Numbers Authority (IANA)</a><br/>* If the added mime type does not work, please turn off the mime type setting or deactivate other mime type plugins.','wp-add-mime-types'); ?></p>
|
90 |
<p><span style="color:red;"><?php if(is_multisite() && is_plugin_active_for_network($plugin_basename)) _e('* The site administrator cannot add the value for mime type because the multisite is enabled. <br/>Please contact the multisite administrator if you would like to add the value.','wp-add-mime-types'); ?></span></p>
|
91 |
|
92 |
<?php // If the permission is not allowed, the user can only read the setting. ?>
|
includes/network-admin.php
CHANGED
@@ -86,7 +86,7 @@ foreach($allowed_mime_values as $type=>$value){
|
|
86 |
|
87 |
<fieldset style="border:1px solid #777777; width: 750px; padding-left: 6px;">
|
88 |
<legend><h3><?php _e('Add Values','wp-add-mime-types'); ?></h3></legend>
|
89 |
-
<p><?php _e('* About the mime type value for the file extension, please search "mime type [file extension name] using a search engine.<br/>
|
90 |
|
91 |
<?php // If the permission is not allowed, the user can only read the setting. ?>
|
92 |
<textarea name="mime_type_values" cols="100" rows="10" <?php if(!$permission) echo "disabled"; ?>><?php if(isset($mimes) && is_array($mimes)) foreach ($mimes as $m_type=>$m_value) echo $m_type . "\t= " .$m_value . "\n"; ?></textarea>
|
86 |
|
87 |
<fieldset style="border:1px solid #777777; width: 750px; padding-left: 6px;">
|
88 |
<legend><h3><?php _e('Add Values','wp-add-mime-types'); ?></h3></legend>
|
89 |
+
<p><?php _e('* About the mime type value for the file extension, please search "mime type [file extension name] using a search engine.<br/>Ex. epub = application/epub+zip<br/>Reference: <a href="http://www.iana.org/assignments/media-types/media-types.xhtml" target="_blank">Media Types on the Internet Assigned Numbers Authority (IANA)</a><br/>* If the added mime type does not work, please turn off the mime type setting or deactivate other mime type plugins.','wp-add-mime-types'); ?></p>
|
90 |
|
91 |
<?php // If the permission is not allowed, the user can only read the setting. ?>
|
92 |
<textarea name="mime_type_values" cols="100" rows="10" <?php if(!$permission) echo "disabled"; ?>><?php if(isset($mimes) && is_array($mimes)) foreach ($mimes as $m_type=>$m_value) echo $m_type . "\t= " .$m_value . "\n"; ?></textarea>
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: Kimiya Kitani
|
3 |
Tags: mime,file extention
|
4 |
Requires at least: 3.0
|
5 |
-
Tested up to: 4.5.
|
6 |
-
Stable tag: 2.0.
|
7 |
|
8 |
The plugin additionally allows the mime types and file extensions to WordPress.
|
9 |
|
@@ -36,6 +36,11 @@ You can see the list of allowed mime types and file extensions by WordPress.
|
|
36 |
|
37 |
== Frequently Asked Questions ==
|
38 |
|
|
|
|
|
|
|
|
|
|
|
39 |
= How do the plugin behave when it is installed and activated on the multisite network administration dashboard? =
|
40 |
The setting in the multisite network administration dashboard is taken precedence. The setting in each site administration dashboard is displayed, but the values aren't applied.
|
41 |
|
@@ -53,6 +58,10 @@ Yes, each setting values are saved as the other setting items.
|
|
53 |
|
54 |
== Changelog ==
|
55 |
|
|
|
|
|
|
|
|
|
56 |
= 2.0.2 =
|
57 |
* Fixed the compatibility with Media Library Assistant plugin.
|
58 |
|
2 |
Contributors: Kimiya Kitani
|
3 |
Tags: mime,file extention
|
4 |
Requires at least: 3.0
|
5 |
+
Tested up to: 4.5.2
|
6 |
+
Stable tag: 2.0.3
|
7 |
|
8 |
The plugin additionally allows the mime types and file extensions to WordPress.
|
9 |
|
36 |
|
37 |
== Frequently Asked Questions ==
|
38 |
|
39 |
+
= Cannot work =
|
40 |
+
If the added mime type does not work, please turn off the mime type setting or deactivate other mime type plugins.
|
41 |
+
|
42 |
+
For example, if you install Media Library Assistant plugin, please turn off "Enable Upload MIME Type Support" in the Upload tag in this plugin setting.
|
43 |
+
|
44 |
= How do the plugin behave when it is installed and activated on the multisite network administration dashboard? =
|
45 |
The setting in the multisite network administration dashboard is taken precedence. The setting in each site administration dashboard is displayed, but the values aren't applied.
|
46 |
|
58 |
|
59 |
== Changelog ==
|
60 |
|
61 |
+
= 2.0.3 =
|
62 |
+
* Fixed the help message in the administration menu.
|
63 |
+
* If the added mime type does not work, please turn off the mime type setting or deactivate other mime type plugins.
|
64 |
+
|
65 |
= 2.0.2 =
|
66 |
* Fixed the compatibility with Media Library Assistant plugin.
|
67 |
|
wp-add-mime-types.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Add Mime Types
|
4 |
Plugin URI:
|
5 |
Description: The plugin additionally allows the mime types and file extensions to WordPress.
|
6 |
-
Version: 2.0.
|
7 |
Author: Kimiya Kitani
|
8 |
Author URI: http://kitaney-wordpress.blogspot.jp/
|
9 |
Text Domain: wp-add-mime-types
|
@@ -19,7 +19,7 @@ add_action('plugins_loaded', 'enable_language_translation');
|
|
19 |
$plugin_basename = plugin_basename ( __FILE__ );
|
20 |
|
21 |
$default_var = array(
|
22 |
-
'wp_add_mime_types' => '2.0.
|
23 |
);
|
24 |
|
25 |
// Add Setting to WordPress 'Settings' menu for Multisite.
|
@@ -30,8 +30,6 @@ if(is_multisite()){
|
|
30 |
add_action('admin_menu', 'add_to_settings_menu');
|
31 |
require_once( dirname( __FILE__ ) . '/includes/admin.php');
|
32 |
|
33 |
-
|
34 |
-
|
35 |
// Procedure for adding the mime types and file extensions to WordPress.
|
36 |
function add_allow_upload_extension( $mimes ) {
|
37 |
global $plugin_basename;
|
@@ -42,7 +40,7 @@ function add_allow_upload_extension( $mimes ) {
|
|
42 |
$settings = get_site_option('wp_add_mime_types_network_array');
|
43 |
else
|
44 |
$settings = get_option('wp_add_mime_types_array');
|
45 |
-
|
46 |
if(!isset($settings['mime_type_values']) || empty($settings['mime_type_values'])) return $mimes;
|
47 |
else
|
48 |
$mime_type_values = unserialize($settings['mime_type_values']);
|
@@ -56,11 +54,8 @@ function add_allow_upload_extension( $mimes ) {
|
|
56 |
$mimes[trim($line_value[0])] = trim(str_replace(" ", " ", $line_value[1]));
|
57 |
}
|
58 |
|
59 |
-
//$mimes['dot'] = 'application/word';
|
60 |
-
|
61 |
return $mimes;
|
62 |
}
|
63 |
|
64 |
// Register the Procedure process to WordPress.
|
65 |
-
add_filter( 'upload_mimes', 'add_allow_upload_extension'
|
66 |
-
|
3 |
Plugin Name: WP Add Mime Types
|
4 |
Plugin URI:
|
5 |
Description: The plugin additionally allows the mime types and file extensions to WordPress.
|
6 |
+
Version: 2.0.3
|
7 |
Author: Kimiya Kitani
|
8 |
Author URI: http://kitaney-wordpress.blogspot.jp/
|
9 |
Text Domain: wp-add-mime-types
|
19 |
$plugin_basename = plugin_basename ( __FILE__ );
|
20 |
|
21 |
$default_var = array(
|
22 |
+
'wp_add_mime_types' => '2.0.3',
|
23 |
);
|
24 |
|
25 |
// Add Setting to WordPress 'Settings' menu for Multisite.
|
30 |
add_action('admin_menu', 'add_to_settings_menu');
|
31 |
require_once( dirname( __FILE__ ) . '/includes/admin.php');
|
32 |
|
|
|
|
|
33 |
// Procedure for adding the mime types and file extensions to WordPress.
|
34 |
function add_allow_upload_extension( $mimes ) {
|
35 |
global $plugin_basename;
|
40 |
$settings = get_site_option('wp_add_mime_types_network_array');
|
41 |
else
|
42 |
$settings = get_option('wp_add_mime_types_array');
|
43 |
+
|
44 |
if(!isset($settings['mime_type_values']) || empty($settings['mime_type_values'])) return $mimes;
|
45 |
else
|
46 |
$mime_type_values = unserialize($settings['mime_type_values']);
|
54 |
$mimes[trim($line_value[0])] = trim(str_replace(" ", " ", $line_value[1]));
|
55 |
}
|
56 |
|
|
|
|
|
57 |
return $mimes;
|
58 |
}
|
59 |
|
60 |
// Register the Procedure process to WordPress.
|
61 |
+
add_filter( 'upload_mimes', 'add_allow_upload_extension');
|
|