WP Add Mime Types - Version 2.0.0

Version Description

  • Supported Multisite.
  • Tested up to WordPress 4.5.1
Download this release

Release Info

Developer kimipooh
Plugin Icon wp plugin WP Add Mime Types
Version 2.0.0
Comparing to
See all releases

Code changes from version 1.3.13 to 2.0.0

includes/admin.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function add_to_settings_menu(){
4
+ $admin_permission = 'manage_options';
5
+ // add_options_page (Title, Setting Title, Permission, Special Definition, function name);
6
+ add_options_page(__('WP Add Mime Types Admin Settings', 'wp-add-mime-types'), __('Mime Type Settings','wp-add-mime-types'), $admin_permission, __FILE__,'admin_settings_page');
7
+ }
8
+
9
+ // Processing Setting menu for the plugin.
10
+ function admin_settings_page(){
11
+ global $plugin_basename;
12
+
13
+ $admin_permission = 'manage_options';
14
+ // Loading the stored setting data (wp_add_mime_types_array) from WordPress database.
15
+ if(is_multisite() && is_plugin_active_for_network($plugin_basename)){
16
+ $settings = get_site_option('wp_add_mime_types_network_array');
17
+ $past_settings = get_option('wp_add_mime_types_array');
18
+ }else
19
+ $settings = get_option('wp_add_mime_types_array');
20
+
21
+ $permission = false;
22
+ // The user who can manage the WordPress option can only access the Setting menu of this plugin.
23
+ if(current_user_can($admin_permission)) $permission = true;
24
+ // If the adding data is not set, the value "mime_type_values" sets "empty".
25
+ if(!isset($settings['mime_type_values'])) $settings['mime_type_values'] = '';
26
+ // When the adding data is saved (posted) at the setting menu, the data will update to the WordPress database after the security check
27
+ if(isset($_POST['mime_type_values'])){
28
+ $p_set = esc_attr(strip_tags(html_entity_decode($_POST['mime_type_values']),ENT_QUOTES));
29
+ $mime_type_values = explode("\n", $p_set);
30
+ foreach($mime_type_values as $m_type=>$m_value)
31
+ // " " is the Japanese multi-byte space. If the character is found out, it automatically change the space.
32
+ $mime_type_values[$m_type] = trim(str_replace(" ", " ", $m_value));
33
+ $settings['mime_type_values'] = serialize($mime_type_values);
34
+ }else
35
+ $mime_type_values = unserialize($settings['mime_type_values']);
36
+
37
+
38
+ // Update to WordPress Data.
39
+ if(is_multisite() && is_plugin_active_for_network($plugin_basename))
40
+ get_site_option('wp_add_mime_types_network_array', $settings);
41
+ else
42
+ update_option('wp_add_mime_types_array', $settings);
43
+
44
+ ?>
45
+ <div class="add_mime_media_admin_setting_page_updated"><p><strong><?php _e('Updated', 'wp-add-mime-types'); ?></strong></p></div>
46
+
47
+ <div id="add_mime_media_admin_menu">
48
+ <h2><?php _e('WP Add Mime Types Admin Settings', 'wp-add-mime-types'); ?></h2>
49
+
50
+ <form method="post" action="">
51
+ <fieldset style="border:1px solid #777777; width: 750px; padding-left: 6px;">
52
+ <legend><h3><?php _e('List of allowed mime types and file extensions by WordPress','wp-add-mime-types'); ?></h3></legend>
53
+ <div style="overflow:scroll; height: 500px;">
54
+ <table>
55
+ <?php
56
+ // Get the list of the file extensions which WordPress allows the upload.
57
+ $allowed_mime_values = get_allowed_mime_types();
58
+
59
+ // Getting the extension name in the saved data
60
+ foreach ($mime_type_values as $line){
61
+ $line_value = explode("=", $line);
62
+ if(count($line_value) != 2) continue;
63
+ $mimes[trim($line_value[0])] = trim($line_value[1]);
64
+ }
65
+
66
+ // List view of the allowed mime types including the addition (red color) in the admin settings.
67
+ foreach($allowed_mime_values as $type=>$value){
68
+ if(isset($mimes)){
69
+ $add_mime_type_check = "";
70
+ foreach($mimes as $a_type=>$a_value){
71
+ if(!strcmp($type, $a_type)){
72
+ $add_mime_type_check = " style='color:red;'";
73
+ break;
74
+ }
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";
80
+ }
81
+ ?>
82
+ </table>
83
+ </div>
84
+ </fieldset>
85
+ <br/>
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 in http://ja.wikipedia.org/wiki/EPUB."','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. ?>
93
+ <textarea name="mime_type_values" cols="100" rows="10" <?php if(!$permission || (is_multisite() && is_plugin_active_for_network($plugin_basename))) echo "disabled"; ?>><?php if(isset($mimes) && is_array($mimes)) foreach ($mimes as $m_type=>$m_value) echo $m_type . "\t= " .$m_value . "\n"; ?></textarea>
94
+ </fieldset>
95
+
96
+ <?php
97
+ if(is_multisite() && current_user_can('manage_network_options')){
98
+ $past_mime_type_values = unserialize($past_settings['mime_type_values']);
99
+ if(!empty($past_mime_type_values)){
100
+
101
+ ?>
102
+ <br/>
103
+ <fieldset style="border:1px solid #777777; width: 750px; padding-left: 6px;">
104
+ <legend><h3><?php _e('Past Add Values before Multisite function was enabled.','wp-add-mime-types'); ?></h3></legend>
105
+ <p><span style="color:red;"><?php _e('* This is for a multisite network administrator when the site was multisite.<br/> The following values are disabled after multisite function was enabled.','wp-add-mime-types'); ?></span></p>
106
+
107
+ <?php // If the permission is not allowed, the user can only read the setting. ?>
108
+ <textarea name="mime_type_values" cols="100" rows="10" disabled><?php if(isset($past_mime_type_values) && is_array($past_mime_type_values)) foreach ($past_mime_type_values as $m_type=>$m_value) echo esc_html($m_value) . "\n"; ?></textarea>
109
+ </fieldset>
110
+
111
+ <?php
112
+ }
113
+ }
114
+ ?>
115
+
116
+ <br/>
117
+
118
+ <input type="submit" value="<?php _e('Save', 'wp-add-mime-types'); ?>" />
119
+ </form>
120
+
121
+ </div>
122
+
123
+ <?php
124
+ }
includes/network-admin.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function network_add_to_settings_menu(){
4
+ global $plugin_basename;
5
+ if( ! is_multisite() || ! is_plugin_active_for_network($plugin_basename))
6
+ return ;
7
+
8
+ $admin_permission = 'manage_network_options';
9
+
10
+ // add_options_page (Title, Setting Title, Permission, Special Definition, function name);
11
+ add_submenu_page( 'settings.php', __('WP Add Mime Types Admin Settings for Network Administrator', 'wp-add-mime-types'), __('Mime Type Settings','wp-add-mime-types'), $admin_permission, __FILE__,'network_admin_settings_page');
12
+ }
13
+
14
+ // Processing Setting menu for the plugin.
15
+ function network_admin_settings_page(){
16
+ $admin_permission = 'manage_network_options';
17
+
18
+ // Loading the stored setting data (wp_add_mime_types_network_array) from WordPress database.
19
+ $settings = get_site_option('wp_add_mime_types_network_array');
20
+
21
+ $permission = false;
22
+ // The user who can manage the WordPress option can only access the Setting menu of this plugin.
23
+ if(current_user_can($admin_permission)) $permission = true;
24
+ // If the adding data is not set, the value "mime_type_values" sets "empty".
25
+ if(!isset($settings['mime_type_values'])) $settings['mime_type_values'] = '';
26
+ // When the adding data is saved (posted) at the setting menu, the data will update to the WordPress database after the security check
27
+ if(isset($_POST['mime_type_values'])){
28
+ $p_set = esc_attr(strip_tags(html_entity_decode($_POST['mime_type_values']),ENT_QUOTES));
29
+ $mime_type_values = explode("\n", $p_set);
30
+ foreach($mime_type_values as $m_type=>$m_value)
31
+ // " " is the Japanese multi-byte space. If the character is found out, it automatically change the space.
32
+ $mime_type_values[$m_type] = trim(str_replace(" ", " ", $m_value));
33
+ $settings['mime_type_values'] = serialize($mime_type_values);
34
+ }else
35
+ $mime_type_values = unserialize($settings['mime_type_values']);
36
+
37
+
38
+ // Update on wp_sitemeta
39
+ update_site_option('wp_add_mime_types_network_array', $settings);
40
+
41
+ ?>
42
+ <div class="network_add_mime_media_admin_setting_page_updated"><p><strong><?php _e('Updated', 'wp-add-mime-types'); ?></strong></p></div>
43
+
44
+ <div id="network_add_mime_media_admin_menu">
45
+ <h2><?php _e('WP Add Mime Types Admin Settings for Network Administrator', 'wp-add-mime-types'); ?></h2>
46
+
47
+ <form method="post" action="">
48
+ <fieldset style="border:1px solid #777777; width: 750px; padding-left: 6px;">
49
+ <legend><h3><?php _e('List of allowed mime types and file extensions by WordPress','wp-add-mime-types'); ?></h3></legend>
50
+ <div style="overflow:scroll; height: 500px;">
51
+ <table>
52
+ <?php
53
+ // Get the list of the file extensions which WordPress allows the upload.
54
+ $allowed_mime_values = get_allowed_mime_types();
55
+
56
+ // Getting the extension name in the saved data
57
+ foreach ($mime_type_values as $line){
58
+ $line_value = explode("=", $line);
59
+ if(count($line_value) != 2) continue;
60
+ $mimes[trim($line_value[0])] = trim($line_value[1]);
61
+ }
62
+
63
+ // List view of the allowed mime types including the addition (red color) in the admin settings.
64
+ foreach($allowed_mime_values as $type=>$value){
65
+ if(isset($mimes)){
66
+ $add_mime_type_check = "";
67
+ foreach($mimes as $a_type=>$a_value){
68
+ if(!strcmp($type, $a_type)){
69
+ $add_mime_type_check = " style='color:red;'";
70
+ break;
71
+ }
72
+ }
73
+
74
+ echo "<tr><td$add_mime_type_check>$type</td><td$add_mime_type_check>=</td><td$add_mime_type_check>$value</td></tr>\n";
75
+ }else
76
+ echo "<tr><td>$type</td><td>=</td><td>$value</td></tr>\n";
77
+ }
78
+ ?>
79
+ </table>
80
+ </div>
81
+ </fieldset>
82
+ <br/>
83
+
84
+ <fieldset style="border:1px solid #777777; width: 750px; padding-left: 6px;">
85
+ <legend><h3><?php _e('Add Values','wp-add-mime-types'); ?></h3></legend>
86
+ <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 in http://ja.wikipedia.org/wiki/EPUB."','wp-add-mime-types'); ?></p>
87
+
88
+ <?php // If the permission is not allowed, the user can only read the setting. ?>
89
+ <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>
90
+ </fieldset>
91
+
92
+ <br/>
93
+
94
+ <input type="submit" value="<?php _e('Save', 'wp-add-mime-types'); ?>" />
95
+ </form>
96
+
97
+ </div>
98
+
99
+ <?php
100
+ }
readme.txt CHANGED
@@ -2,22 +2,22 @@
2
  Contributors: Kimiya Kitani
3
  Tags: mime,file extention
4
  Requires at least: 3.0
5
- Tested up to: 4.5
6
- Stable tag: 1.3.13
7
 
8
  The plugin additionally allows the mime types and file extensions to WordPress.
9
 
10
  == Description ==
11
 
12
- The plugin additionally allows the mime types and file extensions to WordPress. In other words, your WordPress site can upload various file extensions. The support language is English and Japanese.
13
-
14
 
15
  == Installation ==
16
 
17
- The operation is the simple.
18
  Please install this plugin and activate it.
19
  If you use a language except English, please update the translation data in the updates of Dashboard.
20
 
 
 
21
  = Usage =
22
 
23
  First of all, please check the "Media Type Settings" in the "Settings".
@@ -31,15 +31,32 @@ You can see the list of allowed mime types and file extensions by WordPress.
31
  The user who have the [manage_options](http://codex.wordpress.org/Roles_and_Capabilities#manage_options) permission can only add the setting.
32
 
33
  If you would like to translate it to your language, please visit the GlotPress from https://wordpress.org/plugins/wp-add-mime-types/ .
 
 
34
 
35
  == Frequently Asked Questions ==
36
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  == Screenshots ==
39
  1. Setting Menu
 
40
 
41
  == Changelog ==
42
 
 
 
 
 
43
  = 1.3.13 =
44
  * Tested up to WordPress 4.5.
45
 
2
  Contributors: Kimiya Kitani
3
  Tags: mime,file extention
4
  Requires at least: 3.0
5
+ Tested up to: 4.5.1
6
+ Stable tag: 2.0.0
7
 
8
  The plugin additionally allows the mime types and file extensions to WordPress.
9
 
10
  == Description ==
11
 
12
+ The plugin additionally allows the mime types and file extensions to WordPress. In other words, your WordPress site can upload various file extensions.
 
13
 
14
  == Installation ==
15
 
 
16
  Please install this plugin and activate it.
17
  If you use a language except English, please update the translation data in the updates of Dashboard.
18
 
19
+ If the multisite is enabled, please check the setting menu in the network administrator.
20
+
21
  = Usage =
22
 
23
  First of all, please check the "Media Type Settings" in the "Settings".
31
  The user who have the [manage_options](http://codex.wordpress.org/Roles_and_Capabilities#manage_options) permission can only add the setting.
32
 
33
  If you would like to translate it to your language, please visit the GlotPress from https://wordpress.org/plugins/wp-add-mime-types/ .
34
+
35
+ If the multisite is enabled, the multisite network administrator can add/change/delete the mime type value in the multisite network setting menu. And the multisite network administrator or the site administrator can only see the past value (cannot change) before the site was migrated to the multisite.
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
+
42
+ = How do the plugin behave when it is deactivated/uninstalled on the multisite network administration dashboard? =
43
+
44
+ The setting values in each site administration dashboard in case of activating the plugin in each site is applied.
45
+
46
+ = Don't the setting values in the multisite network administration dashboard and the setting values in each site administration dashboard influence each other? =
47
+
48
+ Yes, each setting values are saved as the other setting items.
49
 
50
  == Screenshots ==
51
  1. Setting Menu
52
+ 2. Setting Menu in case of the multisite
53
 
54
  == Changelog ==
55
 
56
+ = 2.0.0 =
57
+ * Supported Multisite.
58
+ * Tested up to WordPress 4.5.1
59
+
60
  = 1.3.13 =
61
  * Tested up to WordPress 4.5.
62
 
screenshot-2.png ADDED
Binary file
wp-add-mime-types.php CHANGED
@@ -3,124 +3,42 @@
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: 1.3.13
7
  Author: Kimiya Kitani
8
- Author URI: https://profiles.wordpress.org/kimipooh/
9
  Text Domain: wp-add-mime-types
10
  Domain Path: /lang
11
  */
12
 
13
  // Multi-language support.
14
  function enable_language_translation(){
15
- // load_plugin_textdomain('wp-add-mime-types', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/');
16
  load_plugin_textdomain('wp-add-mime-types', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/');
17
  }
18
  add_action('plugins_loaded', 'enable_language_translation');
19
 
20
-
21
 
22
  $default_var = array(
23
- 'wp_add_mime_types' => '1.3.13',
24
  );
25
 
26
- // Add Setting to WordPress 'Settings' menu.
27
- add_action('admin_menu', 'add_to_settings_menu');
28
-
29
- function add_to_settings_menu(){
30
-
31
- // add_options_page (Title, Setting Title, Permission, Special Definition, function name);
32
- add_options_page(__('WP Add Mime Types Admin Settings', 'wp-add-mime-types'), __('Mime Type Settings','wp-add-mime-types'), 'manage_options', __FILE__,'admin_settings_page');
33
-
34
  }
 
 
35
 
36
- // Processing Setting menu for the plugin.
37
- function admin_settings_page(){
38
- // Loading the stored setting data (wp_add_mime_types_array) from WordPress database.
39
- $settings = get_option('wp_add_mime_types_array');
40
-
41
- $permission = false;
42
- // The user who can manage the WordPress option can only access the Setting menu of this plugin.
43
- if(current_user_can('manage_options')) $permission = true;
44
- // If the adding data is not set, the value "mime_type_values" sets "empty".
45
- if(!isset($settings['mime_type_values'])) $settings['mime_type_values'] = '';
46
- // When the adding data is saved (posted) at the setting menu, the data will update to the WordPress database after the security check
47
- if(isset($_POST['mime_type_values'])){
48
- $p_set = esc_attr(strip_tags(html_entity_decode($_POST['mime_type_values']),ENT_QUOTES));
49
- $mime_type_values = explode("\n", $p_set);
50
- foreach($mime_type_values as $m_type=>$m_value)
51
- // " " is the Japanese multi-byte space. If the character is found out, it automatically change the space.
52
- $mime_type_values[$m_type] = trim(str_replace(" ", " ", $m_value));
53
- $settings['mime_type_values'] = serialize($mime_type_values);
54
- }else
55
- $mime_type_values = unserialize($settings['mime_type_values']);
56
-
57
-
58
- // Update to WordPress Data.
59
- update_option('wp_add_mime_types_array', $settings);
60
-
61
- ?>
62
- <div class="add_mime_media_admin_setting_page_updated"><p><strong><?php _e('Updated', 'wp-add-mime-types'); ?></strong></p></div>
63
-
64
- <div id="add_mime_media_admin_menu">
65
- <h2><?php _e('WP Add Mime Types Admin Settings', 'wp-add-mime-types'); ?></h2>
66
-
67
- <form method="post" action="">
68
- <fieldset style="border:1px solid #777777; width: 750px; padding-left: 6px;">
69
- <legend><h3><?php _e('List of allowed mime types and file extensions by WordPress','wp-add-mime-types'); ?></h3></legend>
70
- <div style="overflow:scroll; height: 500px;">
71
- <table>
72
- <?php
73
- // Get the list of the file extensions which WordPress allows the upload.
74
- $allowed_mime_values = get_allowed_mime_types();
75
-
76
- // Getting the extension name in the saved data
77
- foreach ($mime_type_values as $line){
78
- $line_value = explode("=", $line);
79
- if(count($line_value) != 2) continue;
80
- $mimes[trim($line_value[0])] = trim($line_value[1]);
81
- }
82
-
83
- // List view of the allowed mime types including the addition (red color) in the admin settings.
84
- foreach($allowed_mime_values as $type=>$value){
85
- if(isset($mimes)){
86
- $add_mime_type_check = "";
87
- foreach($mimes as $a_type=>$a_value){
88
- if(!strcmp($type, $a_type)){
89
- $add_mime_type_check = " style='color:red;'";
90
- break;
91
- }
92
- }
93
-
94
- echo "<tr><td$add_mime_type_check>$type</td><td$add_mime_type_check>=</td><td$add_mime_type_check>$value</td></tr>\n";
95
- }else
96
- echo "<tr><td>$type</td><td>=</td><td>$value</td></tr>\n";
97
- }
98
- ?>
99
- </table>
100
- </div>
101
- </fieldset>
102
- <br/>
103
-
104
- <fieldset style="border:1px solid #777777; width: 750px; padding-left: 6px;">
105
- <legend><h3><?php _e('Add Values','wp-add-mime-types'); ?></h3></legend>
106
- <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 in http://ja.wikipedia.org/wiki/EPUB."','wp-add-mime-types'); ?></p>
107
-
108
- <?php // If the permission is not allowed, the user can only read the setting. ?>
109
- <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>
110
- </fieldset>
111
-
112
- <br/>
113
-
114
- <input type="submit" value="<?php _e('Save', 'wp-add-mime-types'); ?>" />
115
- </form>
116
 
117
- </div>
118
 
119
- <?php
120
- }
121
  // Procedure for adding the mime types and file extensions to WordPress.
122
  function add_allow_upload_extension( $mimes ) {
123
- $settings = get_option('wp_add_mime_types_array');
 
 
 
 
124
 
125
  if(!isset($settings['mime_type_values']) || empty($settings['mime_type_values'])) return $mimes;
126
  else
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.0
7
  Author: Kimiya Kitani
8
+ Author URI: http://kitaney-wordpress.blogspot.jp/
9
  Text Domain: wp-add-mime-types
10
  Domain Path: /lang
11
  */
12
 
13
  // Multi-language support.
14
  function enable_language_translation(){
 
15
  load_plugin_textdomain('wp-add-mime-types', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/');
16
  }
17
  add_action('plugins_loaded', 'enable_language_translation');
18
 
19
+ $plugin_basename = plugin_basename ( __FILE__ );
20
 
21
  $default_var = array(
22
+ 'wp_add_mime_types' => '2.0.0',
23
  );
24
 
25
+ // Add Setting to WordPress 'Settings' menu for Multisite.
26
+ if(is_multisite()){
27
+ add_action('network_admin_menu', 'network_add_to_settings_menu');
28
+ require_once( dirname( __FILE__ ) . '/includes/network-admin.php');
 
 
 
 
29
  }
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;
38
+ if(is_multisite() && is_plugin_active_for_network($plugin_basename))
39
+ $settings = get_site_option('wp_add_mime_types_network_array');
40
+ else
41
+ $settings = get_option('wp_add_mime_types_array');
42
 
43
  if(!isset($settings['mime_type_values']) || empty($settings['mime_type_values'])) return $mimes;
44
  else