Enhanced Media Library - Version 1.0

Version Description

  • New: Enhanced Media Library initial release.
Download this release

Release Info

Developer webbistro
Plugin Icon 128x128 Enhanced Media Library
Version 1.0
Comparing to
See all releases

Version 1.0

core/mime-types.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * wpuxss_eml_mimes_validate
5
+ *
6
+ * @type callback function
7
+ * @since 1.0
8
+ * @created 15/10/13
9
+ */
10
+
11
+ function wpuxss_eml_mimes_validate($input)
12
+ {
13
+ if ( !$input ) $input = array();
14
+
15
+ if ( isset($_REQUEST['wpuxss_eml_restore_mimes_backup']) )
16
+ {
17
+ $_REQUEST['_wp_http_referer'] .= '&settings-restored=true';
18
+ $wpuxss_eml_mimes_backup = get_option('wpuxss_eml_mimes_backup');
19
+ $input = $wpuxss_eml_mimes_backup;
20
+ }
21
+ else
22
+ {
23
+ foreach ( $input as $type => $mime )
24
+ {
25
+ $sanitized_type = wpuxss_eml_sanitize_extension($type);
26
+
27
+ if ( $sanitized_type !== $type )
28
+ {
29
+ $input[$sanitized_type] = $input[$type];
30
+ unset($input[$type]);
31
+ $type = $sanitized_type;
32
+ }
33
+
34
+ if ( !isset($input[$type]['filter']) )
35
+ $input[$type]['filter'] = 0;
36
+
37
+ if ( !isset($input[$type]['upload']) )
38
+ $input[$type]['upload'] = 0;
39
+
40
+ $input[$type]['filter'] = intval($input[$type]['filter']);
41
+ $input[$type]['upload'] = intval($input[$type]['upload']);
42
+
43
+ $input[$type]['mime'] = sanitize_mime_type($mime['mime']);
44
+ $input[$type]['singular'] = sanitize_text_field($mime['singular']);
45
+ $input[$type]['plural'] = sanitize_text_field($mime['plural']);
46
+ }
47
+ }
48
+
49
+ return $input;
50
+ }
51
+
52
+
53
+
54
+
55
+ /**
56
+ * wpuxss_eml_sanitize_extension
57
+ *
58
+ * Based on the original sanitize_key
59
+ *
60
+ * @since 1.0
61
+ * @created 24/10/13
62
+ */
63
+
64
+ function wpuxss_eml_sanitize_extension( $key )
65
+ {
66
+ $raw_key = $key;
67
+ $key = strtolower( $key );
68
+ $key = preg_replace( '/[^a-z0-9|]/', '', $key );
69
+ return apply_filters( 'sanitize_key', $key, $raw_key );
70
+ }
71
+
72
+
73
+
74
+
75
+ /**
76
+ * wpuxss_eml_post_mime_types
77
+ *
78
+ * @since 1.0
79
+ * @created 03/08/13
80
+ */
81
+
82
+ add_filter('post_mime_types', 'wpuxss_eml_post_mime_types');
83
+
84
+ function wpuxss_eml_post_mime_types( $post_mime_types )
85
+ {
86
+ $wpuxss_eml_mimes = get_option('wpuxss_eml_mimes');
87
+
88
+ if ( !empty($wpuxss_eml_mimes) )
89
+ {
90
+ foreach ( $wpuxss_eml_mimes as $type => $mime )
91
+ {
92
+ if ( $mime['filter'] == 1 )
93
+ $post_mime_types[$mime['mime']] = array(
94
+ $mime['singular'],
95
+ 'Manage ' . $mime['singular'],
96
+ _n_noop($mime['singular'] . ' <span class="count">(%s)</span>', $mime['plural'] . ' <span class="count">(%s)</span>')
97
+ );
98
+ }
99
+ }
100
+
101
+ return $post_mime_types;
102
+ }
103
+
104
+
105
+
106
+
107
+ /**
108
+ * wpuxss_eml_upload_mimes
109
+ *
110
+ * @since 1.0
111
+ * @created 03/08/13
112
+ */
113
+
114
+ add_filter('upload_mimes', 'wpuxss_eml_upload_mimes');
115
+
116
+ function wpuxss_eml_upload_mimes ( $existing_mimes=array() )
117
+ {
118
+ $wpuxss_eml_mimes = get_option('wpuxss_eml_mimes');
119
+
120
+ if ( !empty($wpuxss_eml_mimes) )
121
+ {
122
+ foreach ( $wpuxss_eml_mimes as $type => $mime )
123
+ {
124
+ if ( $mime['upload'] == 1 )
125
+ {
126
+ if ( !isset($existing_mimes[$type]) )
127
+ $existing_mimes[$type] = $mime['mime'];
128
+ }
129
+ else
130
+ {
131
+ if ( isset($existing_mimes[$type]) )
132
+ unset($existing_mimes[$type]);
133
+ }
134
+ }
135
+ }
136
+
137
+ return $existing_mimes;
138
+ }
139
+
140
+
141
+
142
+
143
+ /**
144
+ * wpuxss_eml_mime_types
145
+ *
146
+ * @since 1.0
147
+ * @created 03/08/13
148
+ */
149
+
150
+ add_filter( 'mime_types', 'wpuxss_eml_mime_types' );
151
+
152
+ function wpuxss_eml_mime_types( $existing_mimes )
153
+ {
154
+ $wpuxss_eml_mimes = get_option('wpuxss_eml_mimes');
155
+
156
+ if ( !empty($wpuxss_eml_mimes) )
157
+ {
158
+ foreach ( $wpuxss_eml_mimes as $type => $mime )
159
+ {
160
+ if ( !isset($existing_mimes[$type]) )
161
+ $existing_mimes[$type] = $mime['mime'];
162
+ }
163
+
164
+ foreach ( $existing_mimes as $type => $mime )
165
+ {
166
+ if ( !isset($wpuxss_eml_mimes[$type]) && isset($existing_mimes[$type]) )
167
+ unset($existing_mimes[$type]);
168
+ }
169
+ }
170
+
171
+ return $existing_mimes;
172
+ }
173
+
174
+ ?>
core/options-pages.php ADDED
@@ -0,0 +1,545 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * wpuxss_eml_admin_menu
5
+ *
6
+ * @since 1.0
7
+ * @created 28/09/13
8
+ */
9
+
10
+ add_action('admin_menu', 'wpuxss_eml_admin_menu');
11
+
12
+ function wpuxss_eml_admin_menu()
13
+ {
14
+ add_utility_page(
15
+ __('Enhanced Media Library Options','eml'), //page_title
16
+ __('Media Settings','eml'), //menu_title
17
+ 'manage_options', //capability
18
+ 'eml-taxonomies-options', //page
19
+ 'wpuxss_eml_print_taxonomies_options' //callback
20
+ );
21
+
22
+ $eml_taxonomies_options_suffix = add_submenu_page(
23
+ 'eml-taxonomies-options',
24
+ __('Taxonomies','eml'),
25
+ __('Taxonomies','eml'),
26
+ 'manage_options',
27
+ 'eml-taxonomies-options'
28
+ );
29
+
30
+ $eml_mimetype_options_suffix = add_submenu_page(
31
+ 'eml-taxonomies-options',
32
+ __('MIME Types','eml'),
33
+ __('MIME Types','eml'),
34
+ 'manage_options',
35
+ 'eml-mimetype-options',
36
+ 'wpuxss_eml_print_mimetypes_options'
37
+ );
38
+
39
+ add_action('admin_print_scripts-' . $eml_taxonomies_options_suffix, 'wpuxss_eml_admin_settings_pages_scripts');
40
+ add_action('admin_print_scripts-' . $eml_mimetype_options_suffix, 'wpuxss_eml_admin_settings_pages_scripts');
41
+ }
42
+
43
+
44
+
45
+
46
+ /**
47
+ * wpuxss_eml_admin_settings_scripts
48
+ *
49
+ * @since 1.0
50
+ * @created 28/10/13
51
+ */
52
+
53
+ function wpuxss_eml_admin_settings_pages_scripts()
54
+ {
55
+ global $wpuxss_eml_version;
56
+
57
+ wp_enqueue_script(
58
+ 'wpuxss-eml-options-script',
59
+ plugins_url( '../js/eml-options.js' , __FILE__ ),
60
+ array('jquery'),
61
+ $wpuxss_eml_version,
62
+ true
63
+ );
64
+
65
+ $i18n_data = array(
66
+ 'edit' => __( 'Edit', 'eml' ),
67
+ 'close' => __( 'Close', 'eml' ),
68
+ 'view' => __( 'View', 'eml' ),
69
+ 'update' => __( 'Update', 'eml' ),
70
+ 'add_new' => __( 'Add New', 'eml' ),
71
+ 'new' => __( 'New', 'eml' ),
72
+ 'name' => __( 'Name', 'eml' ),
73
+ 'parent' => __( 'Parent', 'eml' ),
74
+ 'all' => __( 'All', 'eml' ),
75
+ 'search' => __( 'Search', 'eml' ),
76
+
77
+ 'tax_deletion_confirm' => __( 'Taxonomy will be deleted permanently! Your media files will remain intacted, but all the connections with this taxonomy and its terms will be lost.', 'eml' ),
78
+ 'tax_error_duplicate' => __( 'There is already a taxonomy with the same name. Please chose other one.', 'eml' ),
79
+ 'tax_new' => __( 'New Taxonomy', 'eml' ),
80
+ 'tax_error_empty_both' => __( 'Please choose Singular and Plural names for all your new taxomonies.', 'eml' ),
81
+ 'tax_error_empty_singular' => __( 'Please choose Singilar name for all your new taxomonies.', 'eml' ),
82
+ 'tax_error_empty_plural' => __( 'Please choose Plural Name for all your new taxomonies.', 'eml' ),
83
+
84
+ 'mime_deletion_confirm' => __( 'Warning! All your custom MIME Types will be deleted by this operation.', 'eml' ),
85
+ 'mime_error_empty_fields' => __( 'Please fill into all fields.', 'eml' ),
86
+ 'mime_error_duplicate' => __( 'Duplicate extensions or MIME types. Please chose other one.', 'eml' )
87
+ );
88
+
89
+ wp_localize_script(
90
+ 'wpuxss-eml-options-script',
91
+ 'wpuxss_eml_i18n_data',
92
+ $i18n_data
93
+ );
94
+ }
95
+
96
+
97
+
98
+
99
+ /**
100
+ * wpuxss_eml_print_taxonomies_options
101
+ *
102
+ * @type callback function
103
+ * @since 1.0
104
+ * @created 28/09/13
105
+ */
106
+
107
+ function wpuxss_eml_print_taxonomies_options()
108
+ {
109
+ if (!current_user_can('manage_options'))
110
+ wp_die( __('You do not have sufficient permissions to access this page.','eml') );
111
+
112
+ $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
113
+ $taxonomies = get_taxonomies(array(),'names');
114
+ ?>
115
+
116
+ <div id="wpuxss-eml-global-options-wrap" class="wrap">
117
+ <?php screen_icon('options-general'); ?>
118
+ <h2><?php _e('Taxonomies','eml'); ?></h2>
119
+
120
+ <?php settings_errors(); ?>
121
+
122
+ <div id="poststuff">
123
+
124
+ <div id="post-body" class="metabox-holder columns-2">
125
+
126
+ <div id="postbox-container-2" class="postbox-container">
127
+
128
+ <form id="wpuxss-eml-form-taxonomies" method="post" action="options.php">
129
+
130
+ <?php settings_fields( 'wpuxss_eml_taxonomies' ); ?>
131
+
132
+ <div class="postbox">
133
+
134
+ <h3><?php _e('Media Taxonomies','eml'); ?></h3>
135
+
136
+ <div class="inside">
137
+
138
+ <p><?php _e('Assign following taxonomies to Media Library:','eml'); ?></p>
139
+
140
+ <?php
141
+
142
+ $html = '';
143
+ foreach ( get_taxonomies(array(),'object') as $taxonomy )
144
+ {
145
+ if ( (in_array('attachment',$taxonomy->object_type) && count($taxonomy->object_type) == 1) || empty($taxonomy->object_type) )
146
+ {
147
+ $assigned = intval($wpuxss_eml_taxonomies[$taxonomy->name]['assigned']);
148
+ $eml_media = intval($wpuxss_eml_taxonomies[$taxonomy->name]['eml_media']);
149
+
150
+ if ($eml_media)
151
+ $li_class = 'wpuxss-eml-taxonomy';
152
+ else
153
+ $li_class = 'wpuxss-non-eml-taxonomy';
154
+
155
+ $html .= '<li class="' . $li_class . '" id="' . $taxonomy->name . '">';
156
+
157
+ $html .= '<input class="wpuxss-eml-assigned" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][assigned]" type="checkbox" value="1" ' . checked( true, $assigned, false ) . ' />';
158
+ $html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][eml_media]" type="hidden" value="' . $eml_media . '" />';
159
+ $html .= ' <label>' . $taxonomy->label . '</label>';
160
+ $html .= '<a class="wpuxss-eml-button-edit" title="' . __('Edit Taxonomy','eml') . '" href="javascript:;">' . __('Edit','eml') . ' &darr;</a>';
161
+ if ( $wpuxss_eml_taxonomies[$taxonomy->name]['eml_media'] == 1 )
162
+ {
163
+ $html .= '<a class="wpuxss-eml-button-remove" title="' . __('Delete Taxonomy','eml') . '" href="javascript:;">&ndash;</a>';
164
+
165
+ $html .= '<div class="wpuxss-eml-taxonomy-edit" style="display:none;">';
166
+
167
+ $html .= '<div class="wpuxss-eml-labels-edit">';
168
+ $html .= '<h4>' . __('Labels','eml') . '</h4>';
169
+ $html .= '<ul>';
170
+ $html .= '<li><label>' . __('Singular','eml') . '</label><input type="text" class="wpuxss-eml-singular_name" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][labels][singular_name]" value="' . esc_html($taxonomy->labels->singular_name) . '" /></li>';
171
+ $html .= '<li><label>' . __('Plural','eml') . '</label><input type="text" class="wpuxss-eml-name" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][labels][name]" value="' . esc_html($taxonomy->labels->name) . '" /></li>';
172
+ $html .= '<li><label>' . __('Menu Name','eml') . '</label><input type="text" class="wpuxss-eml-menu_name" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][labels][menu_name]" value="' . esc_html($taxonomy->labels->menu_name) . '" /></li>';
173
+ $html .= '<li><label>' . __('All','eml') . '</label><input type="text" class="wpuxss-eml-all_items" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][labels][all_items]" value="' . esc_html($taxonomy->labels->all_items) . '" /></li>';
174
+ $html .= '<li><label>' . __('Edit','eml') . '</label><input type="text" class="wpuxss-eml-edit_item" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][labels][edit_item]" value="' . esc_html($taxonomy->labels->edit_item) . '" /></li>';
175
+ $html .= '<li><label>' . __('View','eml') . '</label><input type="text" class="wpuxss-eml-view_item" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][labels][view_item]" value="' . esc_html($taxonomy->labels->view_item) . '" /></li>';
176
+ $html .= '<li><label>' . __('Update','eml') . '</label><input type="text" class="wpuxss-eml-update_item" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][labels][update_item]" value="' . esc_html($taxonomy->labels->update_item) . '" /></li>';
177
+ $html .= '<li><label>' . __('Add New','eml') . '</label><input type="text" class="wpuxss-eml-add_new_item" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][labels][add_new_item]" value="' . esc_html($taxonomy->labels->add_new_item) . '" /></li>';
178
+ $html .= '<li><label>' . __('New','eml') . '</label><input type="text" class="wpuxss-eml-new_item_name" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][labels][new_item_name]" value="' . esc_html($taxonomy->labels->new_item_name) . '" /></li>';
179
+ $html .= '<li><label>' . __('Parent','eml') . '</label><input type="text" class="wpuxss-eml-parent_item" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][labels][parent_item]" value="' . esc_html($taxonomy->labels->parent_item) . '" /></li>';
180
+ $html .= '<li><label>' . __('Search','eml') . '</label><input type="text" class="wpuxss-eml-search_items" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][labels][search_items]" value="' . esc_html($taxonomy->labels->search_items) . '" /></li>';
181
+ $html .= '</ul>';
182
+ $html .= '</div>';
183
+
184
+ $html .= '<div class="wpuxss-eml-settings-edit">';
185
+ $html .= '<h4>' . __('Settings','eml') . '</h4>';
186
+ $html .= '<ul>';
187
+ $html .= '<li><label>' . __('Hierarchical','eml') . '</label><input type="checkbox" class="wpuxss-eml-hierarchical" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][hierarchical]" value="1" ' . checked( 1, $taxonomy->hierarchical, false ) . ' /></li>';
188
+ $html .= '<li><label>' . __('Column in Media Library','eml') . '</label><input type="checkbox" class="wpuxss-eml-show_admin_column" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][show_admin_column]" value="1" ' . checked( 1, $taxonomy->show_admin_column, false ) . ' /></li>';
189
+ $html .= '<li><label>' . __('Filter in Media Library','eml') . '</label><input type="checkbox" class="wpuxss-eml-admin_filter" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][admin_filter]" value="1" ' . checked( 1, $wpuxss_eml_taxonomies[$taxonomy->name]['admin_filter'], false ) . ' /></li>';
190
+ $html .= '<li><label>' . __('Filter in Media Uploader','eml') . '</label><input type="checkbox" class="wpuxss-eml-media_uploader_filter" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][media_uploader_filter]" value="1" ' . checked( 1, $wpuxss_eml_taxonomies[$taxonomy->name]['media_uploader_filter'], false ) . ' /></li>';
191
+ $html .= '<li><label>' . __('Show in Nav Menu','eml') . '</label><input type="checkbox" class="wpuxss-eml-show_in_nav_menus" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][show_in_nav_menus]" value="1" ' . checked( 1, $taxonomy->show_in_nav_menus, false ) . ' /></li>';
192
+ $html .= '<li><label>' . __('Remember terms order (sort)','eml') . '</label><input type="checkbox" class="wpuxss-eml-sort" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][sort]" value="1" ' . checked( 1, $taxonomy->sort, false ) . ' /></li>';
193
+ $html .= '<li><label>' . __('Slug','eml') . '</label><input type="text" class="wpuxss-eml-slug" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][rewrite][slug]" value="' . esc_attr($taxonomy->rewrite['slug']) . '" /></li>';
194
+ $html .= '</ul>';
195
+ $html .= '</div>';
196
+
197
+ $html .= '</div>';
198
+ }
199
+ else
200
+ {
201
+ $html .= '<div class="wpuxss-eml-taxonomy-edit" style="display:none;">';
202
+
203
+ $html .= '<div class="wpuxss-eml-settings-edit">';
204
+ $html .= '<h4>' . __('Settings','eml') . '</h4>';
205
+ $html .= '<ul>';
206
+ $html .= '<li><label>' . __('Filter in Media Library','eml') . '</label><input type="checkbox" class="wpuxss-eml-admin_filter" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][admin_filter]" value="1" ' . checked( 1, $wpuxss_eml_taxonomies[$taxonomy->name]['admin_filter'], false ) . ' /></li>';
207
+ $html .= '<li><label>' . __('Filter in Media Uploader','eml') . '</label><input type="checkbox" class="wpuxss-eml-media_uploader_filter" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][media_uploader_filter]" value="1" ' . checked( 1, $wpuxss_eml_taxonomies[$taxonomy->name]['media_uploader_filter'], false ) . ' /></li>';
208
+ $html .= '</ul>';
209
+
210
+ $html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][show_admin_column]" type="hidden" value="' . $wpuxss_eml_taxonomies[$taxonomy->name]['show_admin_column'] . '" />';
211
+ $html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][show_in_nav_menus]" type="hidden" value="' . $wpuxss_eml_taxonomies[$taxonomy->name]['show_in_nav_menus'] . '" />';
212
+ $html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][hierarchical]" type="hidden" value="' . $wpuxss_eml_taxonomies[$taxonomy->name]['hierarchical'] . '" />';
213
+ $html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][sort]" type="hidden" value="' . $wpuxss_eml_taxonomies[$taxonomy->name]['sort'] . '" />';
214
+ $html .= '</div>';
215
+
216
+ $html .= '</div>';
217
+ }
218
+ $html .= '</li>';
219
+ }
220
+ }
221
+
222
+ $html .= '<li class="wpuxss-eml-clone" style="display:none">';
223
+ $html .= '<input class="wpuxss-eml-assigned" name="" type="checkbox" class="wpuxss-eml-assigned" value="1" checked="checked" />';
224
+ $html .= '<input name="" type="hidden" class="wpuxss-eml-eml_media" value="1" />';
225
+ $html .= ' <label class="wpuxss-eml-taxonomy-label">' . __('New Taxonomy','eml') . '</label>';
226
+
227
+ $html .= '<a class="wpuxss-eml-button-remove" title="' . __('Delete Taxonomy','eml') . '" href="javascript:;">&ndash;</a>';
228
+
229
+ $html .= '<div class="wpuxss-eml-taxonomy-edit">';
230
+
231
+ $html .= '<div class="wpuxss-eml-labels-edit">';
232
+ $html .= '<h4>' . __('Labels','eml') . '</h4>';
233
+ $html .= '<ul>';
234
+ $html .= '<li><label>' . __('Singular','eml') . '</label><input type="text" class="wpuxss-eml-singular_name" name="" value="" /></li>';
235
+ $html .= '<li><label>' . __('Plural','eml') . '</label><input type="text" class="wpuxss-eml-name" name="" value="" /></li>';
236
+ $html .= '<li><label>' . __('Menu Name','eml') . '</label><input type="text" class="wpuxss-eml-menu_name" name="" value="" /></li>';
237
+ $html .= '<li><label>' . __('All','eml') . '</label><input type="text" class="wpuxss-eml-all_items" name="" value="" /></li>';
238
+ $html .= '<li><label>' . __('Edit','eml') . '</label><input type="text" class="wpuxss-eml-edit_item" name="" value="" /></li>';
239
+ $html .= '<li><label>' . __('View','eml') . '</label><input type="text" class="wpuxss-eml-view_item" name="" value="" /></li>';
240
+ $html .= '<li><label>' . __('Update','eml') . '</label><input type="text" class="wpuxss-eml-update_item" name="" value="" /></li>';
241
+ $html .= '<li><label>' . __('Add New','eml') . '</label><input type="text" class="wpuxss-eml-add_new_item" name="" value="" /></li>';
242
+ $html .= '<li><label>' . __('New','eml') . '</label><input type="text" class="wpuxss-eml-new_item_name" name="" value="" /></li>';
243
+ $html .= '<li><label>' . __('Parent','eml') . '</label><input type="text" class="wpuxss-eml-parent_item" name="" value="" /></li>';
244
+ $html .= '<li><label>' . __('Search','eml') . '</label><input type="text" class="wpuxss-eml-search_items" name="" value="" /></li>';
245
+ $html .= '</ul>';
246
+ $html .= '</div>';
247
+
248
+ $html .= '<div class="wpuxss-eml-settings-edit">';
249
+ $html .= '<h4>' . __('Settings','eml') . '</h4>';
250
+ $html .= '<ul>';
251
+ $html .= '<li><label>' . __('Hierarchical','eml') . '</label><input type="checkbox" class="wpuxss-eml-hierarchical" name="" value="1" checked="checked" /></li>';
252
+ $html .= '<li><label>' . __('Column in Media Library','eml') . '</label><input class="wpuxss-eml-show_admin_column" type="checkbox" name="" value="1" /></li>';
253
+ $html .= '<li><label>' . __('Filter in Media Library','eml') . '</label><input class="wpuxss-eml-admin_filter" type="checkbox" name="" value="1" /></li>';
254
+ $html .= '<li><label>' . __('Filter in Media Uploader','eml') . '</label><input class="wpuxss-eml-media_uploader_filter" type="checkbox" name="" value="1" /></li>';
255
+ $html .= '<li><label>' . __('Show in Nav Menu','eml') . '</label><input type="checkbox" class="wpuxss-eml-show_in_nav_menus" name="" value="1" /></li>';
256
+ $html .= '<li><label>' . __('Remember terms order (sort)','eml') . '</label><input type="checkbox" class="wpuxss-eml-sort" name="" value="1" /></li>';
257
+ $html .= '<li><label>' . __('Slug','eml') . '</label><input type="text" class="wpuxss-eml-slug" name="" value="" /></li>';
258
+ $html .= '</ul>';
259
+ $html .= '</div>';
260
+
261
+ $html .= '</div>';
262
+ $html .= '</li>';
263
+
264
+ if ( !empty($html) )
265
+ {
266
+ ?>
267
+ <ul class="wpuxss-eml-settings-list wpuxss-eml-media-taxonomy-list">
268
+ <?php echo $html; ?>
269
+ </ul>
270
+ <div class="wpuxss-eml-button-container-right"><a class="add-new-h2 wpuxss-eml-button-create-taxonomy" href="javascript:;">+ <?php _e('Add New Taxonomy','eml'); ?></a></div>
271
+ <?php
272
+ }
273
+
274
+ submit_button();
275
+ ?>
276
+
277
+ </div>
278
+
279
+ </div>
280
+
281
+ <div class="postbox">
282
+
283
+ <h3><?php _e('Non-Media Taxonomies','eml'); ?></h3>
284
+
285
+ <div class="inside">
286
+
287
+ <p><?php _e('Assign following taxonomies to Media Library:','eml'); ?></p>
288
+
289
+ <?php
290
+ $unuse = array('revision','nav_menu_item','attachment');
291
+ foreach ( get_post_types(array(),'object') as $post_type )
292
+ {
293
+ if ( !in_array($post_type->name,$unuse) )
294
+ {
295
+ $taxonomies = get_object_taxonomies($post_type->name,'object');
296
+ if ( !empty($taxonomies) )
297
+ {
298
+ $html = '';
299
+ foreach ( $taxonomies as $taxonomy )
300
+ {
301
+ if ( $taxonomy->name != 'post_format' )
302
+ {
303
+ $html .= '<li>';
304
+ $html .= '<input class="wpuxss-eml-assigned" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][assigned]" type="checkbox" value="1" ' . checked( 1, $wpuxss_eml_taxonomies[$taxonomy->name]['assigned'], false ) . ' />';
305
+ $html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][eml_media]" type="hidden" value="' . $wpuxss_eml_taxonomies[$taxonomy->name]['eml_media'] . '" />';
306
+ $html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][show_admin_column]" type="hidden" value="' . $wpuxss_eml_taxonomies[$taxonomy->name]['show_admin_column'] . '" />';
307
+ $html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][show_in_nav_menus]" type="hidden" value="' . $wpuxss_eml_taxonomies[$taxonomy->name]['show_in_nav_menus'] . '" />';
308
+ $html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][hierarchical]" type="hidden" value="' . $wpuxss_eml_taxonomies[$taxonomy->name]['hierarchical'] . '" />';
309
+ $html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][sort]" type="hidden" value="' . $wpuxss_eml_taxonomies[$taxonomy->name]['sort'] . '" />';
310
+ $html .= ' <label>' . $taxonomy->label . '</label>';
311
+ $html .= '<a class="wpuxss-eml-button-edit" title="' . __('Edit Taxonomy','eml') . '" href="javascript:;">' . __('Edit','eml') . ' &darr;</a>';
312
+ $html .= '<div class="wpuxss-eml-taxonomy-edit" style="display:none;">';
313
+
314
+ $html .= '<h4>' . __('Settings','eml') . '</h4>';
315
+ $html .= '<ul>';
316
+ $html .= '<li><label>' . __('Filter in Media Library','eml') . '</label><input type="checkbox" class="wpuxss-eml-admin_filter" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][admin_filter]" value="1" ' . checked( 1, $wpuxss_eml_taxonomies[$taxonomy->name]['admin_filter'], false ) . ' /></li>';
317
+ $html .= '<li><label>' . __('Filter in Media Uploader','eml') . '</label><input type="checkbox" class="wpuxss-eml-media_uploader_filter" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][media_uploader_filter]" value="1" ' . checked( 1, $wpuxss_eml_taxonomies[$taxonomy->name]['media_uploader_filter'], false ) . ' /></li>';
318
+ $html .= '</ul>';
319
+
320
+ $html .= '</div>';
321
+ $html .= '</li>';
322
+
323
+ }
324
+ }
325
+ if ( !empty($html) )
326
+ {
327
+ ?>
328
+ <h4><?php echo $post_type->label; ?></h4>
329
+ <ul class="wpuxss-eml-settings-list wpuxss-eml-non-media-taxonomy-list">
330
+ <?php echo $html; ?>
331
+ </ul>
332
+ <?php
333
+ }
334
+ }
335
+ }
336
+ }
337
+
338
+ submit_button();
339
+ ?>
340
+
341
+ </div>
342
+
343
+ </div>
344
+
345
+ </form>
346
+
347
+ </div>
348
+
349
+ <div id="postbox-container-1" class="postbox-container">
350
+
351
+ <?php wpuxss_eml_print_credits(); ?>
352
+
353
+ </div>
354
+
355
+ </div>
356
+
357
+ </div>
358
+
359
+ </div>
360
+
361
+ <?php
362
+ }
363
+
364
+
365
+
366
+
367
+ /**
368
+ * wpuxss_eml_print_mimetypes_options
369
+ *
370
+ * @type callback function
371
+ * @since 1.0
372
+ * @created 28/09/13
373
+ */
374
+
375
+ function wpuxss_eml_print_mimetypes_options()
376
+ {
377
+ if (!current_user_can('manage_options'))
378
+ wp_die( __('You do not have sufficient permissions to access this page.','eml') );
379
+
380
+ $wpuxss_eml_mimes = get_option('wpuxss_eml_mimes');
381
+ $wpuxss_eml_mimes_backup = get_option('wpuxss_eml_mimes_backup');
382
+ ?>
383
+
384
+ <div id="wpuxss-eml-global-options-wrap" class="wrap">
385
+ <?php screen_icon('options-general'); ?>
386
+ <h2>
387
+ <?php _e('MIME Types','eml'); ?>
388
+ <a class="add-new-h2 wpuxss-eml-button-create-mime" href="javascript:;">+ <?php _e('Add New MIME Type','eml'); ?></a>
389
+ </h2>
390
+
391
+ <?php settings_errors(); ?>
392
+
393
+ <div id="poststuff">
394
+
395
+ <div id="post-body" class="metabox-holder columns-2">
396
+
397
+ <div id="postbox-container-2" class="postbox-container">
398
+
399
+ <form method="post" action="options.php" id="wpuxss-eml-form-mimetypes">
400
+
401
+ <?php settings_fields( 'wpuxss_eml_mimes' ); ?>
402
+
403
+ <table class="wpuxss-eml-mime-type-list wp-list-table widefat" cellspacing="0">
404
+ <thead>
405
+ <tr>
406
+ <th scope="col" class="manage-column wpuxss-eml-column-extension"><?php _e('Extension','eml'); ?></th>
407
+ <th scope="col" class="manage-column wpuxss-eml-column-mime"><?php _e('MIME Type','eml'); ?></th>
408
+ <th scope="col" class="manage-column wpuxss-eml-column-singular"><?php _e('Singular Label','eml'); ?></th>
409
+ <th scope="col" class="manage-column wpuxss-eml-column-plural"><?php _e('Plural Label','eml'); ?></th>
410
+ <th scope="col" class="manage-column wpuxss-eml-column-filter"><?php _e('Add Filter','eml'); ?></th>
411
+ <th scope="col" class="manage-column wpuxss-eml-column-upload"><?php _e('Allow Upload','eml'); ?></th>
412
+ <th scope="col" class="manage-column wpuxss-eml-column-delete"></th>
413
+ </tr>
414
+ </thead>
415
+
416
+
417
+ <tbody>
418
+
419
+ <?php
420
+ $allowed_mimes = get_allowed_mime_types();
421
+ $all_mimes = wp_get_mime_types();
422
+ ksort($all_mimes,SORT_STRING);
423
+
424
+ foreach ( $all_mimes as $type => $mime )
425
+ {
426
+ if ( isset($wpuxss_eml_mimes[$type]) )
427
+ {
428
+ $label = '<code>'. str_replace( '|', '</code>, <code>', $type ) .'</code>';
429
+
430
+ $allowed = false;
431
+ if ( array_key_exists( $type,$allowed_mimes ) )
432
+ $allowed = true;
433
+ ?>
434
+
435
+ <tr>
436
+ <td id="<?php echo $type; ?>"><?php echo $label; ?></td>
437
+ <td><code><?php echo $mime; ?></code><input type="hidden" class="wpuxss-eml-mime" name="wpuxss_eml_mimes[<?php echo $type; ?>][mime]" value="<?php echo $wpuxss_eml_mimes[$type]['mime']; ?>" /></td>
438
+ <td><input type="text" name="wpuxss_eml_mimes[<?php echo $type; ?>][singular]" value="<?php echo esc_html($wpuxss_eml_mimes[$type]['singular']); ?>" /></td>
439
+ <td><input type="text" name="wpuxss_eml_mimes[<?php echo $type; ?>][plural]" value="<?php echo esc_html($wpuxss_eml_mimes[$type]['plural']); ?>" /></td>
440
+ <td class="checkbox_td"><input type="checkbox" name="wpuxss_eml_mimes[<?php echo $type; ?>][filter]" value="1" <?php checked(1, $wpuxss_eml_mimes[$type]['filter']); ?> /></td>
441
+ <td class="checkbox_td"><input type="checkbox" name="wpuxss_eml_mimes[<?php echo $type; ?>][upload]" value="1" <?php checked(true, $allowed); ?> /></td>
442
+ <td><a class="wpuxss-eml-button-remove" title="Delete MIME Type" href="javascript:;">&ndash;</a></td>
443
+ </tr>
444
+
445
+ <?php
446
+ }
447
+ }
448
+ ?>
449
+
450
+ <tr class="wpuxss-eml-clone" style="display:none;">
451
+ <td><input type="text" class="wpuxss-eml-type" placeholder="jpg|jpeg|jpe" /></td>
452
+ <td><input type="text" class="wpuxss-eml-mime" placeholder="image/jpeg" /></td>
453
+ <td><input type="text" class="wpuxss-eml-singular" placeholder="Image" /></td>
454
+ <td><input type="text" class="wpuxss-eml-plural" placeholder="Images" /></td>
455
+ <td class="checkbox_td"><input type="checkbox" class="wpuxss-eml-filter" value="1" /></td>
456
+ <td class="checkbox_td"><input type="checkbox" class="wpuxss-eml-upload" value="1" /></td>
457
+ <td><a class="wpuxss-eml-button-remove" title="<?php _e('Delete MIME Type','eml'); ?>" href="javascript:;">&ndash;</a></td>
458
+ </tr>
459
+
460
+ </tbody>
461
+ <tfoot>
462
+ <tr>
463
+ <th scope="col" class="manage-column wpuxss-eml-column-extension"><?php _e('Extension','eml'); ?></th>
464
+ <th scope="col" class="manage-column wpuxss-eml-column-mime"><?php _e('MIME Type','eml'); ?></th>
465
+ <th scope="col" class="manage-column wpuxss-eml-column-singular"><?php _e('Singular Label','eml'); ?></th>
466
+ <th scope="col" class="manage-column wpuxss-eml-column-plural"><?php _e('Plural Label','eml'); ?></th>
467
+ <th scope="col" class="manage-column wpuxss-eml-column-filter"><?php _e('Add Filter','eml'); ?></th>
468
+ <th scope="col" class="manage-column wpuxss-eml-column-upload"><?php _e('Allow Upload','eml'); ?></th>
469
+ <th scope="col" class="manage-column wpuxss-eml-column-delete"></th>
470
+ </tr>
471
+ </tfoot>
472
+ </table>
473
+
474
+ <?php submit_button(__('Restore default MIME Types','eml'),'secondary','wpuxss_eml_restore_mimes_backup'); ?>
475
+
476
+ <?php submit_button(); ?>
477
+
478
+ </form>
479
+
480
+ </div>
481
+
482
+ <div id="postbox-container-1" class="postbox-container">
483
+
484
+ <?php wpuxss_eml_print_credits(); ?>
485
+
486
+ </div>
487
+
488
+ </div>
489
+
490
+ </div>
491
+
492
+ </div>
493
+
494
+ <?php
495
+ }
496
+
497
+
498
+
499
+
500
+
501
+ /**
502
+ * wpuxss_eml_print_credits
503
+ *
504
+ * @since 1.0
505
+ * @created 28/09/13
506
+ */
507
+
508
+ function wpuxss_eml_print_credits()
509
+ {
510
+ global $wpuxss_eml_version;
511
+ ?>
512
+
513
+ <div class="postbox" id="wpuxss-credits">
514
+
515
+ <h3>Enhanced Media Library <?php echo $wpuxss_eml_version; ?></h3>
516
+
517
+ <div class="inside">
518
+
519
+ <h4>Changelog</h4>
520
+ <p>What's new in <a href="http://wordpress.org/plugins/enhanced-media-library/changelog/">version <?php echo $wpuxss_eml_version; ?></a>.</p>
521
+
522
+ <h4>Support</h4>
523
+ <p>Feel free to ask for support on the <a href="http://wordpress.org/support/plugin/enhanced-media-library">wordpress.org</a>.</p>
524
+
525
+ <h4>Plugin rating</h4>
526
+ <p>Please <a href="http://wordpress.org/support/view/plugin-reviews/enhanced-media-library">vote for the plugin</a>. Thanks!</p>
527
+
528
+ <h4>Other plugins you may find useful</h4>
529
+ <ul>
530
+ <li><a href="http://wordpress.org/plugins/toolbar-publish-button/">Toolbar Publish Button</a></li>
531
+ </ul>
532
+
533
+ <div class="author">
534
+ <span><a href="http://wordpressuxsolutions.com/">WordPress UX Solutions</a> by <a class="logo-webbistro" href="http://twitter.com/webbistro"><span class="icon-webbistro">@</span>webbistro</a></span>
535
+ </div>
536
+
537
+ </div>
538
+
539
+ </div>
540
+
541
+ <?php
542
+ }
543
+
544
+
545
+ ?>
core/taxonomies.php ADDED
@@ -0,0 +1,402 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * wpuxss_eml_unregister_taxonomy_for_object_type
5
+ *
6
+ * Unassign taxonomy
7
+ *
8
+ * @since 1.0
9
+ * @created 10/10/13
10
+ */
11
+
12
+ function wpuxss_eml_unregister_taxonomy_for_object_type( $taxonomy, $object_type )
13
+ {
14
+ global $wp_taxonomies;
15
+
16
+ if ( ! isset( $wp_taxonomies[ $taxonomy ] ) )
17
+ return false;
18
+
19
+ if ( ! get_post_type_object( $object_type ) )
20
+ return false;
21
+
22
+ $key = array_search( $object_type, $wp_taxonomies[ $taxonomy ]->object_type, true );
23
+ if ( false === $key )
24
+ return false;
25
+
26
+ unset( $wp_taxonomies[ $taxonomy ]->object_type[ $key ] );
27
+ return true;
28
+ }
29
+
30
+
31
+
32
+
33
+ /**
34
+ * wpuxss_eml_taxonomies_validate
35
+ *
36
+ * @type callback function
37
+ * @since 1.0
38
+ * @created 28/09/13
39
+ */
40
+
41
+ function wpuxss_eml_taxonomies_validate($input)
42
+ {
43
+ if ( !$input ) $input = array();
44
+
45
+ foreach ( $input as $taxonomy => $params )
46
+ {
47
+ $sanitized_taxonomy = sanitize_key($taxonomy);
48
+
49
+ if ( $sanitized_taxonomy !== $taxonomy )
50
+ {
51
+ $input[$sanitized_taxonomy] = $input[$taxonomy];
52
+ unset($input[$taxonomy]);
53
+ $taxonomy = $sanitized_taxonomy;
54
+ }
55
+
56
+ if ( !isset($params['hierarchical']) )
57
+ $input[$taxonomy]['hierarchical'] = 0;
58
+
59
+ if ( !isset($params['sort']) )
60
+ $input[$taxonomy]['sort'] = 0;
61
+
62
+ if ( !isset($params['show_admin_column']) )
63
+ $input[$taxonomy]['show_admin_column'] = 0;
64
+
65
+ if ( !isset($params['show_in_nav_menus']) )
66
+ $input[$taxonomy]['show_in_nav_menus'] = 0;
67
+
68
+ if ( !isset($params['assigned']) )
69
+ $input[$taxonomy]['assigned'] = 0;
70
+
71
+ if ( !isset($params['admin_filter']) )
72
+ $input[$taxonomy]['admin_filter'] = 0;
73
+
74
+ if ( !isset($params['media_uploader_filter']) )
75
+ $input[$taxonomy]['media_uploader_filter'] = 0;
76
+
77
+ $input[$taxonomy]['hierarchical'] = intval($input[$taxonomy]['hierarchical']);
78
+ $input[$taxonomy]['sort'] = intval($input[$taxonomy]['sort']);
79
+ $input[$taxonomy]['show_admin_column'] = intval($input[$taxonomy]['show_admin_column']);
80
+ $input[$taxonomy]['show_in_nav_menus'] = intval($input[$taxonomy]['show_in_nav_menus']);
81
+ $input[$taxonomy]['assigned'] = intval($input[$taxonomy]['assigned']);
82
+ $input[$taxonomy]['admin_filter'] = intval($input[$taxonomy]['admin_filter']);
83
+ $input[$taxonomy]['media_uploader_filter'] = intval($input[$taxonomy]['media_uploader_filter']);
84
+
85
+ if ( isset($params['labels']) )
86
+ {
87
+ $default_labels = array(
88
+ 'menu_name' => $params['labels']['name'],
89
+ 'all_items' => 'All ' . $params['labels']['name'],
90
+ 'edit_item' => 'Edit ' . $params['labels']['singular_name'],
91
+ 'view_item' => 'View ' . $params['labels']['singular_name'],
92
+ 'update_item' => 'Update ' . $params['labels']['singular_name'],
93
+ 'add_new_item' => 'Add New ' . $params['labels']['singular_name'],
94
+ 'new_item_name' => 'New ' . $params['labels']['singular_name'] . ' Name',
95
+ 'parent_item' => 'Parent ' . $params['labels']['singular_name'],
96
+ 'search_items' => 'Search ' . $params['labels']['name']
97
+ );
98
+
99
+ foreach ( $params['labels'] as $label => $value )
100
+ {
101
+ $input[$taxonomy]['labels'][$label] = sanitize_text_field($value);
102
+
103
+ if ( empty($value) && isset($default_labels[$label]) )
104
+ {
105
+ $input[$taxonomy]['labels'][$label] = sanitize_text_field($default_labels[$label]);
106
+ }
107
+ }
108
+ }
109
+
110
+ if ( isset($params['rewrite']['slug']) )
111
+ $input[$taxonomy]['rewrite']['slug'] = sanitize_key($params['rewrite']['slug']);
112
+ }
113
+
114
+ return $input;
115
+ }
116
+
117
+
118
+
119
+
120
+ /**
121
+ * wpuxss_eml_ajax_query_attachments
122
+ *
123
+ * Based on /wp-admin/includes/ajax-actions.php
124
+ *
125
+ * @since 1.0
126
+ * @created 03/08/13
127
+ */
128
+
129
+ add_action( 'wp_ajax_query-attachments', 'wpuxss_eml_ajax_query_attachments', 0 );
130
+
131
+ function wpuxss_eml_ajax_query_attachments()
132
+ {
133
+ if ( ! current_user_can( 'upload_files' ) )
134
+ wp_send_json_error();
135
+
136
+ $query = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array();
137
+ $query = array_intersect_key( $query, array_flip( array(
138
+ 's', 'order', 'orderby', 'posts_per_page', 'paged', 'post_mime_type',
139
+ 'post_parent', 'post__in', 'post__not_in', 'taxonomy', 'term_id',
140
+ ) ) );
141
+
142
+
143
+ $query['post_type'] = 'attachment';
144
+ $query['post_status'] = 'inherit';
145
+ if ( current_user_can( get_post_type_object( 'attachment' )->cap->read_private_posts ) )
146
+ $query['post_status'] .= ',private';
147
+ if ( isset( $query['taxonomy'] ) && isset( $query['term_id'] ) && $query['term_id'] != 0)
148
+ {
149
+ $query['tax_query'] = array(
150
+ array(
151
+ 'taxonomy' => $query['taxonomy'],
152
+ 'field' => 'id',
153
+ 'terms' => $query['term_id']
154
+ )
155
+ );
156
+ }
157
+ else
158
+ {
159
+ $query['tax_query'] = null;
160
+ }
161
+ unset ( $query['taxonomy'] );
162
+ unset ( $query['term_id'] );
163
+
164
+ $query = new WP_Query( $query );
165
+
166
+ $posts = array_map( 'wp_prepare_attachment_for_js', $query->posts );
167
+ $posts = array_filter( $posts );
168
+
169
+ wp_send_json_success( $posts );
170
+ }
171
+
172
+
173
+
174
+
175
+ /**
176
+ * wpuxss_eml_restrict_manage_posts
177
+ *
178
+ * Filter media by category
179
+ *
180
+ * @since 1.0
181
+ * @created 11/08/13
182
+ */
183
+
184
+ add_action('restrict_manage_posts','wpuxss_eml_restrict_manage_posts');
185
+
186
+ function wpuxss_eml_restrict_manage_posts()
187
+ {
188
+ global $pagenow, $wp_query;
189
+
190
+ $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
191
+
192
+ if ( $pagenow == 'upload.php' )
193
+ {
194
+ foreach ( get_object_taxonomies('attachment','object') as $taxonomy )
195
+ {
196
+ if ( $wpuxss_eml_taxonomies[$taxonomy->name]['admin_filter'] )
197
+ {
198
+ if ( isset($wp_query->query[$taxonomy->name]) )
199
+ {
200
+ $selected = $wp_query->query[$taxonomy->name];
201
+ }
202
+ elseif ( isset($wp_query->query['taxonomy']) && isset($wp_query->query['term']) )
203
+ {
204
+ $term = get_term_by( 'slug', $wp_query->query['term'], $taxonomy->name );
205
+ $selected = $term->term_id;
206
+ }
207
+ else
208
+ {
209
+ $selected = 0;
210
+ }
211
+
212
+ wp_dropdown_categories(
213
+ array(
214
+ 'show_option_all' => $taxonomy->labels->all_items,
215
+ 'taxonomy' => $taxonomy->name,
216
+ 'name' => $taxonomy->name,
217
+ 'orderby' => 'name',
218
+ 'selected' => $selected,
219
+ 'hierarchical' => true,
220
+ 'depth' => 3,
221
+ 'show_count' => false,
222
+ 'hide_if_empty' => true
223
+ )
224
+ );
225
+ }
226
+ }
227
+ }
228
+ }
229
+
230
+
231
+
232
+
233
+ /**
234
+ * wpuxss_eml_parse_query
235
+ *
236
+ * @since 1.0
237
+ * @created 11/08/13
238
+ */
239
+
240
+ add_filter('parse_query', 'wpuxss_eml_parse_query');
241
+
242
+ function wpuxss_eml_parse_query($query)
243
+ {
244
+ global $pagenow;
245
+
246
+ if ( $pagenow=='upload.php' )
247
+ {
248
+ $qv = &$query->query_vars;
249
+
250
+ foreach ( get_object_taxonomies('attachment','object') as $taxonomy )
251
+ {
252
+ if ( isset($qv[$taxonomy->name]) && is_numeric($qv[$taxonomy->name]) )
253
+ {
254
+ $term = get_term_by('id', $qv[$taxonomy->name], $taxonomy->name);
255
+ if ($term) $qv[$taxonomy->name] = $term->slug;
256
+ }
257
+ }
258
+ }
259
+ }
260
+
261
+
262
+
263
+
264
+ /**
265
+ * wpuxss_eml_attachment_fields_to_edit
266
+ *
267
+ * @since 1.0
268
+ * @created 14/08/13
269
+ */
270
+
271
+ add_filter( 'attachment_fields_to_edit', 'wpuxss_eml_attachment_fields_to_edit', 10, 2 );
272
+
273
+ function wpuxss_eml_attachment_fields_to_edit( $form_fields, $post )
274
+ {
275
+ foreach ( get_attachment_taxonomies($post->ID) as $taxonomy )
276
+ {
277
+ $terms = get_object_term_cache($post->ID, $taxonomy);
278
+
279
+ $t = (array) get_taxonomy($taxonomy);
280
+ if ( ! $t['public'] || ! $t['show_ui'] )
281
+ continue;
282
+ if ( empty($t['label']) )
283
+ $t['label'] = $taxonomy;
284
+ if ( empty($t['args']) )
285
+ $t['args'] = array();
286
+
287
+
288
+ if ( false === $terms )
289
+ $terms = wp_get_object_terms($post->ID, $taxonomy, $t['args']);
290
+
291
+ $values = array();
292
+
293
+ foreach ( $terms as $term )
294
+ $values[] = $term->slug;
295
+
296
+ $t['value'] = join(', ', $values);
297
+ $t['show_in_edit'] = false;
298
+
299
+ if ( $t['hierarchical'] )
300
+ {
301
+ ob_start();
302
+
303
+ wp_terms_checklist( $post->ID, array( 'taxonomy' => $taxonomy, 'checked_ontop' => false, 'walker' => new Walker_Media_Taxonomy_Checklist() ) );
304
+
305
+ if ( ob_get_contents() != false )
306
+ $html = '<ul class="term-list">' . ob_get_contents() . '</ul>';
307
+ else
308
+ $html = '<ul class="term-list"><li>No ' . $t['label'] . '</li></ul>';
309
+
310
+ ob_end_clean();
311
+
312
+ $html .= '<input type="hidden" class="text" id="attachments-'.$post->ID.'-'.$taxonomy.'" name="attachments['.$post->ID.']['.$taxonomy.']" value="'.$t['value'].'">';
313
+
314
+ $t['input'] = 'html';
315
+ $t['html'] = $html;
316
+ }
317
+
318
+ $form_fields[$taxonomy] = $t;
319
+ }
320
+
321
+ return $form_fields;
322
+ }
323
+
324
+
325
+
326
+
327
+ /**
328
+ * Walker_Media_Taxonomy_Checklist
329
+ *
330
+ * Based on /wp-includes/category-template.php
331
+ *
332
+ * @since 1.0
333
+ * @created 09/09/13
334
+ */
335
+
336
+ class Walker_Media_Taxonomy_Checklist extends Walker
337
+ {
338
+ var $tree_type = 'category';
339
+ var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
340
+
341
+ function start_lvl( &$output, $depth = 0, $args = array() )
342
+ {
343
+ $indent = str_repeat("\t", $depth);
344
+ $output .= "$indent<ul class='children'>\n";
345
+ }
346
+
347
+ function end_lvl( &$output, $depth = 0, $args = array() )
348
+ {
349
+ $indent = str_repeat("\t", $depth);
350
+ $output .= "$indent</ul>\n";
351
+ }
352
+
353
+ function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 )
354
+ {
355
+ extract($args);
356
+
357
+ if ( empty($taxonomy) )
358
+ $taxonomy = 'category';
359
+
360
+ if ( $taxonomy == 'category' )
361
+ $name = 'post_category';
362
+ else
363
+ $name = 'tax_input['.$taxonomy.']';
364
+
365
+ $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : '';
366
+ $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->slug . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . checked( in_array( $category->term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters('the_category', $category->name )) . '</label>';
367
+ }
368
+
369
+ function end_el( &$output, $category, $depth = 0, $args = array() )
370
+ {
371
+ $output .= "</li>\n";
372
+ }
373
+ }
374
+
375
+
376
+
377
+
378
+ /**
379
+ * wpuxss_eml_pre_get_posts
380
+ *
381
+ * Taxonomy archive specific query (front-end)
382
+ *
383
+ * @since 1.0
384
+ * @created 03/08/13
385
+ */
386
+
387
+ add_action( 'pre_get_posts', 'wpuxss_eml_pre_get_posts' );
388
+
389
+ function wpuxss_eml_pre_get_posts( $query )
390
+ {
391
+ $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
392
+
393
+ foreach ( $wpuxss_eml_taxonomies as $taxonomy => $params )
394
+ {
395
+ if ( $params['assigned'] && $query->is_main_query() && is_tax($taxonomy) && !is_admin() )
396
+ {
397
+ $query->set( 'post_status', 'inherit' );
398
+ }
399
+ }
400
+ }
401
+
402
+ ?>
css/eml-admin.css ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* == Attachment Fields == */
3
+
4
+ .compat-item .field input[type="checkbox"] {
5
+ width: auto;
6
+ }
7
+
8
+ .term-list {
9
+ background-color: #fff;
10
+ border: 1px solid #dfdfdf;
11
+ border-radius: 3px;
12
+ padding: 10px 10px 5px;
13
+ margin: 0 0 10px;
14
+ font-size: 11px;
15
+ }
16
+ .term-list .children {
17
+ margin: 5px 0 0 20px;
18
+ }
19
+
20
+
21
+ /* == Taxonomy Filters == */
22
+
23
+ .media-frame select[class^="attachment"] {
24
+ margin-top: 11px;
25
+ margin-right: 10px;
26
+ max-width: 140px;
27
+ }
28
+
29
+ .media-frame .search {
30
+ line-height: 14px;
31
+ }
32
+
33
+
34
+ /* == Media Uploader Boxes' Positions == */
35
+
36
+ .attachments-browser .media-toolbar {
37
+ height: 80px;
38
+ }
39
+
40
+ .attachments-browser .attachments {
41
+ top: 80px;
42
+ }
43
+ .attachments-browser .media-toolbar-secondary {
44
+ width:75%;
45
+ }
46
+
47
+
48
+ /* == MIME types Option Page Styles == */
49
+
50
+ .wpuxss-eml-mime-type-list {
51
+ table-layout: fixed;
52
+ }
53
+ .wpuxss-eml-mime-type-list td {
54
+ padding: 8px 7px;
55
+ }
56
+ .wpuxss-eml-mime-type-list .checkbox_td {
57
+ text-align: center;
58
+ }
59
+ .wpuxss-eml-mime-type-list input[type="text"] {
60
+ width: 120px;
61
+ }
62
+ .wpuxss-eml-column-extension {
63
+ width: 130px;
64
+ }
65
+ .wpuxss-eml-column-singular,
66
+ .wpuxss-eml-column-plural {
67
+ width:120px;
68
+ }
69
+ .wpuxss-eml-column-filter {
70
+ width: 70px;
71
+ }
72
+ .wpuxss-eml-column-upload {
73
+ width: 90px;
74
+ }
75
+ .wpuxss-eml-column-delete {
76
+ width: 30px;
77
+ }
78
+
79
+
80
+ /* == Taxonomies Option Page Styles == */
81
+
82
+ .wpuxss-eml-settings-list {
83
+ border-top: 1px solid #dfdfdf;
84
+ }
85
+ .wpuxss-eml-settings-list > li {
86
+ border-bottom: 1px solid #dfdfdf;
87
+ padding: 8px 7px;
88
+ margin: 0;
89
+ position: relative;
90
+ overflow: hidden;
91
+ }
92
+ .wpuxss-eml-settings-list > li > label {
93
+ font-size: 14px;
94
+ display: inline-block;
95
+ margin-right: 100px;
96
+ }
97
+ .wpuxss-eml-settings-list input {
98
+ margin: 0;
99
+ }
100
+ .wpuxss-eml-settings-list > li .wpuxss-eml-button-edit {
101
+ position: absolute;
102
+ right: 40px;
103
+ top: 7px;
104
+ text-decoration: none;
105
+ height: 14px;
106
+ line-height: 14px;
107
+ border-radius: 10px;
108
+ box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
109
+ padding: 3px 10px;
110
+ }
111
+ .wpuxss-eml-settings-list.wpuxss-eml-non-media-taxonomy-list > li .wpuxss-eml-button-edit {
112
+ right: 10px;
113
+ }
114
+ .wpuxss-eml-settings-list > li .wpuxss-eml-button-remove {
115
+ position: absolute;
116
+ right: 10px;
117
+ top: 7px;
118
+ }
119
+ .wpuxss-eml-settings-list .wpuxss-eml-assigned {
120
+ margin-right:10px;
121
+ }
122
+
123
+ .wpuxss-eml-taxonomy-edit label {
124
+ display: inline-block;
125
+ width: 160px;
126
+ }
127
+ .wpuxss-eml-taxonomy-edit .wpuxss-eml-labels-edit {
128
+ float: left;
129
+ width: 49%;
130
+ margin-right: 1%;
131
+ }
132
+ .wpuxss-eml-taxonomy-edit .wpuxss-eml-settings-edit {
133
+ float: left;
134
+ width: 49%;
135
+ margin-left: 1%;
136
+ }
137
+ .wpuxss-eml-taxonomy-edit .wpuxss-eml-settings-edit li {
138
+ padding: 3px 0;
139
+ }
140
+ .wpuxss-eml-taxonomy-edit .wpuxss-eml-labels-edit label {
141
+ display: inline-block;
142
+ width: 100px;
143
+ }
144
+ .wpuxss-eml-taxonomy-edit .wpuxss-eml-labels-edit input {
145
+ min-width: 150px;
146
+ }
147
+
148
+
149
+
150
+
151
+ /* == Buttons Styles == */
152
+
153
+ .wpuxss-eml-button-remove {
154
+ display: inline-block;
155
+ text-align: center;
156
+ text-decoration: none;
157
+ line-height: 1em;
158
+ font-size: 18px;
159
+ font-family: Arial, Helvetica, sans-serif;
160
+ height: 20px;
161
+ width: 20px;
162
+ border-radius: 10px;
163
+ box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
164
+ }
165
+ .wpuxss-eml-button-remove:hover {
166
+ box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
167
+ }
168
+ .wpuxss-eml-button-container-right {
169
+ text-align: right;
170
+ margin: 20px 0 0;
171
+ }
172
+
173
+
174
+ /* == Option Page Generic Styles == */
175
+
176
+ #toplevel_page_media-library .wp-menu-image {
177
+ background-position: -119px -33px !important;
178
+ }
179
+
180
+ #wpuxss-eml-global-options-wrap .postbox {
181
+ background-image:none !important;
182
+ background-color:#f9f9f9 !important;
183
+ position: relative;
184
+ }
185
+
186
+ #wpuxss-eml-global-options-wrap .postbox#wpuxss-credits {
187
+ background-color: #fff !important;
188
+ }
189
+ #wpuxss-credits .author {
190
+ font-style: italic;
191
+ margin: 30px 0 0;
192
+ padding: 10px 0 5px;
193
+ border-top: 1px solid #e0e5e9;
194
+ }
195
+ #wpuxss-credits .logo-webbistro {
196
+ font-style: italic;
197
+ text-decoration: none;
198
+ }
199
+ #wpuxss-credits .icon-webbistro {
200
+ font-family: 'webbistro';
201
+ speak: none;
202
+ font-style: normal;
203
+ font-weight: normal;
204
+ font-variant: normal;
205
+ text-transform: none;
206
+ line-height: 1;
207
+ -webkit-font-smoothing: antialiased;
208
+ }
209
+ #wpuxss-credits h4 {
210
+ margin: 20px 0 4px;
211
+ }
212
+ #wpuxss-credits p,
213
+ #wpuxss-credits ul {
214
+ margin-top: 0;
215
+ }
216
+ #wpuxss-credits li {
217
+ list-style: disc;
218
+ margin-left: 1.4em;
219
+ }
220
+
221
+ @font-face {
222
+ font-family: 'webbistro';
223
+ src:url('../fonts/webbistro.eot');
224
+ src:url('../fonts/webbistro.eot?#iefix') format('embedded-opentype'),
225
+ url('../fonts/webbistro.woff') format('woff'),
226
+ url('../fonts/webbistro.ttf') format('truetype'),
227
+ url('../fonts/webbistro.svg#webbistro') format('svg');
228
+ font-weight: normal;
229
+ font-style: normal;
230
+ }
enhanced-media-library.php ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Enhanced Media Library
4
+ Plugin URI: http://wordpressuxsolutions.com
5
+ Description: Better management for WordPress Media Library.
6
+ Version: 1.0
7
+ Author: WordPress UX Solutions
8
+ Author URI: http://wordpressuxsolutions.com
9
+ License: GPLv2 or later
10
+ Text Domain: eml
11
+ Domain Path: /languages
12
+
13
+
14
+ Copyright 2013 WordPress UX Solutions (email : WordPressUXSolutions@gmail.com)
15
+
16
+ This program is free software; you can redistribute it and/or modify
17
+ it under the terms of the GNU General Public License, version 2, as
18
+ published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program; if not, write to the Free Software
27
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28
+
29
+ */
30
+
31
+
32
+
33
+
34
+ $wpuxss_eml_version = '1.0';
35
+ $wpuxss_eml_old_version = get_option('wpuxss_eml_version', false);
36
+
37
+
38
+
39
+
40
+ include_once( 'core/mime-types.php' );
41
+ include_once( 'core/taxonomies.php' );
42
+
43
+ if( is_admin() )
44
+ {
45
+ include_once( 'core/options-pages.php' );
46
+ }
47
+
48
+
49
+
50
+
51
+ /**
52
+ * Load plugin text domain
53
+ *
54
+ * @since 1.0
55
+ * @created 03/08/13
56
+ */
57
+
58
+ load_plugin_textdomain('eml', false, basename( dirname( __FILE__ ) ) . '/languages' );
59
+
60
+
61
+
62
+
63
+ /**
64
+ * wpuxss_eml_on_init
65
+ *
66
+ * @since 1.0
67
+ * @created 03/08/13
68
+ */
69
+
70
+ add_action('init', 'wpuxss_eml_on_init', 12);
71
+
72
+ function wpuxss_eml_on_init()
73
+ {
74
+ // on activation
75
+ wpuxss_eml_on_activation();
76
+
77
+ $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
78
+ if ( empty($wpuxss_eml_taxonomies) ) $wpuxss_eml_taxonomies = array();
79
+
80
+ // register eml taxonomies
81
+ foreach ( $wpuxss_eml_taxonomies as $taxonomy => $params )
82
+ {
83
+ if ( $params['eml_media'] == 1 && !empty($params['labels']['singular_name']) && !empty($params['labels']['name']) )
84
+ {
85
+ register_taxonomy(
86
+ $taxonomy,
87
+ 'attachment',
88
+ array(
89
+ 'labels' => $params['labels'],
90
+ 'public' => true,
91
+ 'show_admin_column' => $params['show_admin_column'],
92
+ 'show_in_nav_menus' => $params['show_in_nav_menus'],
93
+ 'hierarchical' => $params['hierarchical'],
94
+ 'update_count_callback' => '_update_generic_term_count',
95
+ 'sort' => $params['sort'],
96
+ 'rewrite' => array( 'slug' => $params['rewrite']['slug'] )
97
+ )
98
+ );
99
+ }
100
+ }
101
+ }
102
+
103
+
104
+
105
+
106
+ /**
107
+ * wpuxss_eml_on_wp_loaded
108
+ *
109
+ * @since 1.0
110
+ * @created 03/11/13
111
+ */
112
+ add_action( 'wp_loaded', 'wpuxss_eml_on_wp_loaded' );
113
+
114
+ function wpuxss_eml_on_wp_loaded()
115
+ {
116
+ $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
117
+ if ( empty($wpuxss_eml_taxonomies) ) $wpuxss_eml_taxonomies = array();
118
+ $taxonomies = get_taxonomies(array(),'object');
119
+
120
+ // discover 'foreign' taxonomies
121
+ foreach ( $taxonomies as $taxonomy => $params )
122
+ {
123
+ if ( !empty($params->object_type) && !array_key_exists($taxonomy,$wpuxss_eml_taxonomies) && !in_array('revision',$params->object_type) && !in_array('nav_menu_item',$params->object_type) && $taxonomy != 'post_format' )
124
+ {
125
+ $wpuxss_eml_taxonomies[$taxonomy] = array(
126
+ 'eml_media' => 0,
127
+ 'admin_filter' => 0,
128
+ 'media_uploader_filter' => 0,
129
+ 'show_admin_column' => isset($params->show_admin_column) ? $params->show_admin_column : 0,
130
+ 'show_in_nav_menus' => isset($params->show_in_nav_menus) ? $params->show_in_nav_menus : 0,
131
+ 'hierarchical' => $params->hierarchical ? 1 : 0,
132
+ 'sort' => isset($params->sort) ? $params->sort : 0
133
+ );
134
+
135
+ if ( in_array('attachment',$params->object_type) )
136
+ $wpuxss_eml_taxonomies[$taxonomy]['assigned'] = 1;
137
+ else
138
+ $wpuxss_eml_taxonomies[$taxonomy]['assigned'] = 0;
139
+ }
140
+ }
141
+
142
+ // assign/unassign taxonomies to atachment
143
+ foreach ( $wpuxss_eml_taxonomies as $taxonomy => $params )
144
+ {
145
+ if ( $params['assigned'] )
146
+ register_taxonomy_for_object_type( $taxonomy, 'attachment' );
147
+
148
+ if ( ! $params['assigned'] )
149
+ wpuxss_eml_unregister_taxonomy_for_object_type( $taxonomy, 'attachment' );
150
+ }
151
+
152
+ // update_count_callback for attachment taxonomies if needed
153
+ foreach ( $taxonomies as $taxonomy => $params )
154
+ {
155
+ if ( in_array('attachment',$params->object_type) )
156
+ {
157
+ global $wp_taxonomies;
158
+
159
+ if ( !isset($wp_taxonomies[$taxonomy]->update_count_callback) || empty($wp_taxonomies[$taxonomy]->update_count_callback) )
160
+ $wp_taxonomies[$taxonomy]->update_count_callback = '_update_generic_term_count';
161
+ }
162
+ }
163
+
164
+ update_option( 'wpuxss_eml_taxonomies', $wpuxss_eml_taxonomies );
165
+ }
166
+
167
+
168
+
169
+
170
+ /**
171
+ * wpuxss_eml_on_admin_init
172
+ *
173
+ * @since 1.0
174
+ * @created 03/08/13
175
+ */
176
+
177
+ add_action( 'admin_init', 'wpuxss_eml_on_admin_init' );
178
+
179
+ function wpuxss_eml_on_admin_init()
180
+ {
181
+ global $wpuxss_eml_version;
182
+
183
+ // plugin scripts
184
+ wp_enqueue_script(
185
+ 'wpuxss-eml-media-uploader-script',
186
+ plugins_url( '/js/eml-media-uploader.js' , __FILE__ ),
187
+ array('backbone'),
188
+ $wpuxss_eml_version,
189
+ true
190
+ );
191
+
192
+ // admin styles
193
+ wp_enqueue_style(
194
+ 'wpuxss-eml-admin-custom-style',
195
+ plugins_url( '/css/eml-admin.css' , __FILE__ ),
196
+ array(),
197
+ $wpuxss_eml_version,
198
+ 'all'
199
+ );
200
+
201
+
202
+ // pass taxonomies to media uploader's filter
203
+ $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
204
+ if ( empty($wpuxss_eml_taxonomies) ) $wpuxss_eml_taxonomies = array();
205
+
206
+ $taxonomies_array = array();
207
+ foreach ( get_object_taxonomies('attachment','object') as $taxonomy )
208
+ {
209
+ if ( $wpuxss_eml_taxonomies[$taxonomy->name]['media_uploader_filter'] == 1 )
210
+ {
211
+ $args = array (
212
+ 'orderby' => 'name',
213
+ 'order' => 'ASC',
214
+ 'hide_empty' => true,
215
+ 'hierarchical' => true
216
+ );
217
+
218
+ $terms = get_terms( $taxonomy->name, $args );
219
+
220
+ if ( !empty($terms) )
221
+ {
222
+ $terms_array = array();
223
+ foreach ($terms as $term)
224
+ {
225
+ $terms_array[$term->term_id] = $term->name;
226
+ }
227
+
228
+ $taxonomies_array[$taxonomy->name] = array(
229
+ 'list_title' => $taxonomy->labels->all_items,
230
+ 'term_list' => $terms_array
231
+ );
232
+ }
233
+ }
234
+ }
235
+
236
+ wp_localize_script(
237
+ 'wpuxss-eml-media-uploader-script',
238
+ 'wpuxss_eml_taxonomies',
239
+ $taxonomies_array
240
+ );
241
+
242
+
243
+ // plugin settings: taxonomies
244
+ register_setting(
245
+ 'wpuxss_eml_taxonomies', //option_group
246
+ 'wpuxss_eml_taxonomies', //option_name
247
+ 'wpuxss_eml_taxonomies_validate' //sanitize_callback
248
+ );
249
+
250
+ // plugin settings: mime types
251
+ register_setting(
252
+ 'wpuxss_eml_mimes', //option_group
253
+ 'wpuxss_eml_mimes', //option_name
254
+ 'wpuxss_eml_mimes_validate' //sanitize_callback
255
+ );
256
+
257
+ // plugin settings: mime types backup
258
+ register_setting(
259
+ 'wpuxss_eml_mimes_backup', //option_group
260
+ 'wpuxss_eml_mimes_backup' //option_name
261
+ );
262
+ }
263
+
264
+
265
+
266
+
267
+ /**
268
+ * wpuxss_eml_on_activation
269
+ *
270
+ * @since 1.0
271
+ * @created 28/09/13
272
+ */
273
+
274
+ function wpuxss_eml_on_activation()
275
+ {
276
+ global $wpuxss_eml_version, $wpuxss_eml_old_version;
277
+
278
+ if( $wpuxss_eml_version != $wpuxss_eml_old_version )
279
+ update_option('wpuxss_eml_version', $wpuxss_eml_version );
280
+
281
+ if( empty($wpuxss_eml_old_version) || $wpuxss_eml_old_version == '0.0.3' )
282
+ {
283
+ $wpuxss_eml_taxonomies['media_category'] = array(
284
+ 'assigned' => 1,
285
+ 'eml_media' => 1,
286
+ 'admin_filter' => 1,
287
+ 'media_uploader_filter' => 1,
288
+ 'labels' => array(
289
+ 'name' => 'Media Categories',
290
+ 'singular_name' => 'Media Category',
291
+ 'menu_name' => 'Media Categories',
292
+ 'all_items' => 'All Media Categories',
293
+ 'edit_item' => 'Edit Media Category',
294
+ 'view_item' => 'View Media Category',
295
+ 'update_item' => 'Update Media Category',
296
+ 'add_new_item' => 'Add New Media Category',
297
+ 'new_item_name' => 'New Media Category Name',
298
+ 'parent_item' => 'Parent Media Category',
299
+ 'parent_item_colon' => 'Parent Media Category:',
300
+ 'search_items' => 'Search Media Categories'
301
+ ),
302
+ 'public' => true,
303
+ 'show_admin_column' => true,
304
+ 'show_in_nav_menus' => true,
305
+ 'hierarchical' => true,
306
+ 'rewrite' => array( 'slug' => 'media_category' ),
307
+ 'sort' => 0
308
+ );
309
+
310
+ $allowed_mimes = get_allowed_mime_types();
311
+
312
+ foreach ( wp_get_mime_types() as $type => $mime )
313
+ {
314
+ $wpuxss_eml_mimes[$type] = array(
315
+ 'mime' => $mime,
316
+ 'singular' => $mime,
317
+ 'plural' => $mime,
318
+ 'filter' => 0,
319
+ 'upload' => isset($allowed_mimes[$type]) ? 1 : 0
320
+ );
321
+ }
322
+
323
+ $wpuxss_eml_mimes['pdf']['singular'] = 'PDF';
324
+ $wpuxss_eml_mimes['pdf']['plural'] = 'PDFs';
325
+ $wpuxss_eml_mimes['pdf']['filter'] = 1;
326
+
327
+ update_option( 'wpuxss_eml_taxonomies', $wpuxss_eml_taxonomies );
328
+ update_option( 'wpuxss_eml_mimes', $wpuxss_eml_mimes );
329
+ update_option( 'wpuxss_eml_mimes_backup', $wpuxss_eml_mimes );
330
+ }
331
+ }
332
+
333
+ ?>
fonts/webbistro.eot ADDED
Binary file
fonts/webbistro.svg ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>
5
+ This is a custom SVG font generated by IcoMoon.
6
+ <iconset grid="16"></iconset>
7
+ </metadata>
8
+ <defs>
9
+ <font id="webbistro" horiz-adv-x="512" >
10
+ <font-face units-per-em="512" ascent="480" descent="-32" />
11
+ <missing-glyph horiz-adv-x="512" />
12
+ <glyph class="hidden" unicode="&#xf000;" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0" />
13
+ <glyph unicode="&#x40;" d="M 321.146,317.372c-83.358,0-157.511-67.813-171.633-151.4c-8.677-51.307, 9.436-96.506, 43.904-123.833
14
+ c 30.050-9.868, 114.462,22.662, 102.028,119.004C 288.967,211.685, 259.456,279.079, 321.146,317.372z M 333.988,6.287
15
+ c 46.601,0.232, 93.13,10.579, 124.654,26.049c 110.967,54.314, 159.414,168.615, 108.767,256.461C 468.602,460.202, 212.876,430.446, 104.808,329.273
16
+ C-21.68,210.801-17.295,77.389, 60.133-5.444c 47.417-50.658, 135.123-86.695, 226.545-85.802c 63.598,0.613, 138.246,21.674, 193.215,65.351
17
+ c 7.254,5.754, 11.839,9.85, 11.88,15.943c-200.293-106.687-321.122-33.753-366.291,26.716C-13.217,201.692, 187.562,406.614, 357.605,377.148
18
+ c 123.782-21.447, 162.801-114.658, 156.541-188.66c-7.951-92.842-90.201-152.475-142.836-150.82c 49.78,26.722, 88.308,74.151, 97.941,128.304
19
+ c 10.088,56.68-13.931,106.118-57.981,132.057c-33.658-7.43-94.741-53.111-83.268-141.842c 6.576-50.876, 29.86-124.889-36.212-146.051
20
+ C 305.372,6.9, 309.477,6.204, 333.988,6.287z" horiz-adv-x="619.163" />
21
+ <glyph unicode="&#x20;" horiz-adv-x="256" />
22
+ </font></defs></svg>
fonts/webbistro.ttf ADDED
Binary file
fonts/webbistro.woff ADDED
Binary file
js/eml-media-uploader.js ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+
3
+ if ( typeof wp.media !== 'undefined' )
4
+ {
5
+ var media = wp.media,
6
+ l10n = media.view.l10n;
7
+
8
+ $.each(wpuxss_eml_taxonomies, function(taxonomy, values)
9
+ {
10
+
11
+ // Category AttachmentFilters
12
+ media.view.AttachmentFilters[taxonomy] = media.view.AttachmentFilters.extend({
13
+ tagName: 'select',
14
+ className: 'attachment-'+taxonomy+'-filters',
15
+
16
+ createFilters: function() {
17
+ var filters = {};
18
+
19
+ _.each( values.term_list || {}, function( text, key ) {
20
+
21
+ filters[ key ] = {
22
+ text: text,
23
+ props: {
24
+ taxonomy: taxonomy,
25
+ term_id: key
26
+ }
27
+ };
28
+ });
29
+
30
+ filters[0] = {
31
+ text: values.list_title,
32
+ props: {
33
+ taxonomy: taxonomy,
34
+ term_id: 0
35
+ },
36
+ priority: 10
37
+ };
38
+
39
+ this.filters = filters;
40
+ },
41
+
42
+ select: function() {
43
+ var model = this.model,
44
+ value = 0,
45
+ props = model.toJSON();
46
+
47
+ _.find( this.filters, function( filter, id ) {
48
+ var equal = _.all( filter.props, function( prop, key ) {
49
+ return prop === ( _.isUndefined( props[ key ] ) ? null : props[ key ] );
50
+ });
51
+
52
+ if ( equal )
53
+ return value = id;
54
+ });
55
+
56
+ this.$el.val( value );
57
+ }
58
+ });
59
+
60
+ });
61
+
62
+ // Enhanced AttachmentBrowser
63
+ media.view.AttachmentsBrowser = media.view.AttachmentsBrowser.extend({
64
+ createToolbar: function() {
65
+ var filters, FiltersConstructor;
66
+
67
+ this.toolbar = new media.view.Toolbar({
68
+ controller: this.controller
69
+ });
70
+
71
+ this.views.add( this.toolbar );
72
+
73
+ filters = this.options.filters;
74
+ if ( 'uploaded' === filters )
75
+ FiltersConstructor = media.view.AttachmentFilters.Uploaded;
76
+ else if ( 'all' === filters )
77
+ FiltersConstructor = media.view.AttachmentFilters.All;
78
+
79
+ if ( FiltersConstructor ) {
80
+ this.toolbar.set( 'filters', new FiltersConstructor({
81
+ controller: this.controller,
82
+ model: this.collection.props,
83
+ priority: -80
84
+ }).render() );
85
+ }
86
+
87
+ var that = this;
88
+ $.each(wpuxss_eml_taxonomies, function(taxonomy, values)
89
+ {
90
+ if ( filters && values.term_list )
91
+ {
92
+ that.toolbar.set( taxonomy+'-filters', new media.view.AttachmentFilters[taxonomy]({
93
+ controller: that.controller,
94
+ model: that.collection.props,
95
+ priority: -80
96
+ }).render() );
97
+ }
98
+ });
99
+
100
+
101
+ if ( this.options.search ) {
102
+ this.toolbar.set( 'search', new media.view.Search({
103
+ controller: this.controller,
104
+ model: this.collection.props,
105
+ priority: 60
106
+ }).render() );
107
+ }
108
+
109
+ if ( this.options.dragInfo ) {
110
+ this.toolbar.set( 'dragInfo', new media.View({
111
+ el: $( '<div class="instructions">' + l10n.dragInfo + '</div>' )[0],
112
+ priority: -40
113
+ }) );
114
+ }
115
+ }
116
+ });
117
+
118
+ }
119
+
120
+
121
+ $(document).on('change', 'input[name^="tax_input"]', function()
122
+ {
123
+ var tax_list = [];
124
+ var parent = $(this).closest('.term-list');
125
+
126
+ parent.find('input[name^="tax_input"]:checked').each(function(i)
127
+ {
128
+ tax_list[i] = $(this).val();
129
+ });
130
+
131
+ var tax_string = tax_list.join(', ');
132
+
133
+ parent.next('input[name^="attachments"]').val(tax_string).change();
134
+ });
135
+
136
+ })( jQuery );
js/eml-options.js ADDED
@@ -0,0 +1,334 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+
3
+ // remove taxonomy
4
+ $(document).on('click', 'li .wpuxss-eml-button-remove', function()
5
+ {
6
+ target = $(this).parent();
7
+
8
+ if ( target.hasClass('wpuxss-eml-clone-taxonomy') )
9
+ {
10
+ target.hide( 300, function() {
11
+ $(this).remove();
12
+ });
13
+ }
14
+ else
15
+ {
16
+ if ( confirm(wpuxss_eml_i18n_data.tax_deletion_confirm) )
17
+ {
18
+ target.hide( 300, function() {
19
+ $(this).remove();
20
+ });
21
+ }
22
+ }
23
+
24
+ return false;
25
+ });
26
+
27
+ // create new taxonomy
28
+ $(document).on('click', '.wpuxss-eml-button-create-taxonomy', function()
29
+ {
30
+ $('.wpuxss-eml-media-taxonomy-list').find('.wpuxss-eml-clone').clone().attr('class','wpuxss-eml-clone-taxonomy').appendTo('.wpuxss-eml-media-taxonomy-list').show(300);
31
+
32
+ return false;
33
+ });
34
+
35
+ // edit taxonomy parameters
36
+ $(document).on('click', '.wpuxss-eml-button-edit', function()
37
+ {
38
+ $(this).parent().find('.wpuxss-eml-taxonomy-edit').toggle(300);
39
+
40
+ $(this).html(function(i, html)
41
+ {
42
+ return html == wpuxss_eml_i18n_data.edit+' \u2193' ? wpuxss_eml_i18n_data.close+' \u2191' : wpuxss_eml_i18n_data.edit+' \u2193';
43
+ });
44
+
45
+ return false;
46
+ });
47
+
48
+ // on change of a singular taxonomy name during creation
49
+ $(document).on('blur', '.wpuxss-eml-clone-taxonomy .wpuxss-eml-singular_name', function()
50
+ {
51
+ var dictionary,
52
+ taxonomy_name = $(this).val().toLowerCase(),
53
+ taxonomy_edit_box = $(this).parents('.wpuxss-eml-taxonomy-edit');
54
+
55
+ if ( $(this).val() != '' )
56
+ {
57
+ // thanks to
58
+ // https://github.com/borodean/jquery-translit
59
+ // https://gist.github.com/richardsweeney/5317392
60
+ // http://www.advancedcustomfields.com/
61
+ // for the 'dictionary' code!
62
+ dictionary = {
63
+ 'а': 'a',
64
+ 'б': 'b',
65
+ 'в': 'v',
66
+ 'г': 'g',
67
+ 'д': 'd',
68
+ 'е': 'e',
69
+ 'ё': 'e',
70
+ 'ж': 'zh',
71
+ 'з': 'z',
72
+ 'и': 'i',
73
+ 'й': 'i',
74
+ 'к': 'k',
75
+ 'л': 'l',
76
+ 'м': 'm',
77
+ 'н': 'n',
78
+ 'о': 'o',
79
+ 'п': 'p',
80
+ 'р': 'r',
81
+ 'с': 's',
82
+ 'т': 't',
83
+ 'у': 'u',
84
+ 'ф': 'f',
85
+ 'х': 'kh',
86
+ 'ц': 'tc',
87
+ 'ч': 'ch',
88
+ 'ш': 'sh',
89
+ 'щ': 'shch',
90
+ 'ъ': '',
91
+ 'ы': 'y',
92
+ 'ь': '',
93
+ 'э': 'e',
94
+ 'ю': 'iu',
95
+ 'я': 'ia',
96
+ 'ä': 'a',
97
+ 'æ': 'a',
98
+ 'å': 'a',
99
+ 'ö': 'o',
100
+ 'ø': 'o',
101
+ 'é': 'e',
102
+ 'ë': 'e',
103
+ 'ü': 'u',
104
+ 'ó': 'o',
105
+ 'ő': 'o',
106
+ 'ú': 'u',
107
+ 'é': 'e',
108
+ 'á': 'a',
109
+ 'ű': 'u',
110
+ 'í': 'i',
111
+ ' ' : '_',
112
+ '-' : '_',
113
+ '\'' : ''
114
+ };
115
+
116
+ $.each( dictionary, function(k, v)
117
+ {
118
+ var regex = new RegExp( k, 'g' );
119
+ taxonomy_name = taxonomy_name.replace( regex, v );
120
+ });
121
+
122
+ $(this).closest('.wpuxss-eml-clone-taxonomy').attr('id',taxonomy_name);
123
+
124
+ if ( $('.wpuxss-eml-clone-taxonomy[id='+taxonomy_name+'], .wpuxss-eml-taxonomy[id='+taxonomy_name+'], .wpuxss-non-eml-taxonomy[id='+taxonomy_name+']').length > 1 )
125
+ {
126
+ alert(wpuxss_eml_i18n_data.tax_error_duplicate);
127
+ }
128
+
129
+ $(this).attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][singular_name]');
130
+ taxonomy_edit_box.find('.wpuxss-eml-name').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][name]');
131
+ taxonomy_edit_box.find('.wpuxss-eml-menu_name').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][menu_name]');
132
+ taxonomy_edit_box.find('.wpuxss-eml-all_items').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][all_items]');
133
+ taxonomy_edit_box.find('.wpuxss-eml-edit_item').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][edit_item]');
134
+ taxonomy_edit_box.find('.wpuxss-eml-view_item').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][view_item]');
135
+ taxonomy_edit_box.find('.wpuxss-eml-update_item').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][update_item]');
136
+ taxonomy_edit_box.find('.wpuxss-eml-add_new_item').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][add_new_item]');
137
+ taxonomy_edit_box.find('.wpuxss-eml-new_item_name').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][new_item_name]');
138
+ taxonomy_edit_box.find('.wpuxss-eml-parent_item').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][parent_item]');
139
+ taxonomy_edit_box.find('.wpuxss-eml-search_items').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][search_items]');
140
+
141
+ if( taxonomy_edit_box.find('.wpuxss-eml-edit_item').val() == '' )
142
+ taxonomy_edit_box.find('.wpuxss-eml-edit_item').val(wpuxss_eml_i18n_data.edit+' '+$(this).val());
143
+
144
+ if( taxonomy_edit_box.find('.wpuxss-eml-view_item').val() == '' )
145
+ taxonomy_edit_box.find('.wpuxss-eml-view_item').val(wpuxss_eml_i18n_data.view+' '+$(this).val());
146
+
147
+ if( taxonomy_edit_box.find('.wpuxss-eml-update_item').val() == '' )
148
+ taxonomy_edit_box.find('.wpuxss-eml-update_item').val(wpuxss_eml_i18n_data.update+' '+$(this).val());
149
+
150
+ if( taxonomy_edit_box.find('.wpuxss-eml-add_new_item').val() == '' )
151
+ taxonomy_edit_box.find('.wpuxss-eml-add_new_item').val(wpuxss_eml_i18n_data.add_new+' '+$(this).val());
152
+
153
+ if( taxonomy_edit_box.find('.wpuxss-eml-new_item_name').val() == '' )
154
+ taxonomy_edit_box.find('.wpuxss-eml-new_item_name').val(wpuxss_eml_i18n_data.new+' '+$(this).val()+' '+wpuxss_eml_i18n_data.name);
155
+
156
+ if( taxonomy_edit_box.find('.wpuxss-eml-parent_item').val() == '' )
157
+ taxonomy_edit_box.find('.wpuxss-eml-parent_item').val(wpuxss_eml_i18n_data.parent+' '+$(this).val());
158
+
159
+ taxonomy_edit_box.find('.wpuxss-eml-hierarchical').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][hierarchical]');
160
+ taxonomy_edit_box.find('.wpuxss-eml-public').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][public]');
161
+ taxonomy_edit_box.find('.wpuxss-eml-show_admin_column').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][show_admin_column]');
162
+ taxonomy_edit_box.find('.wpuxss-eml-show_in_nav_menus').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][show_in_nav_menus]');
163
+ taxonomy_edit_box.find('.wpuxss-eml-sort').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][sort]');
164
+ taxonomy_edit_box.find('.wpuxss-eml-slug').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][rewrite][slug]').val(taxonomy_name);
165
+
166
+ taxonomy_edit_box.find('.wpuxss-eml-admin_filter').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][admin_filter]');
167
+ taxonomy_edit_box.find('.wpuxss-eml-media_uploader_filter').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][media_uploader_filter]');
168
+
169
+ $(this).closest('.wpuxss-eml-clone-taxonomy').find('.wpuxss-eml-assigned').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][assigned]');
170
+ $(this).closest('.wpuxss-eml-clone-taxonomy').find('.wpuxss-eml-eml_media').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][eml_media]');
171
+ }
172
+ else
173
+ {
174
+ taxonomy_edit_box.find('.wpuxss-eml-edit_item').val('');
175
+ taxonomy_edit_box.find('.wpuxss-eml-view_item').val('');
176
+ taxonomy_edit_box.find('.wpuxss-eml-update_item').val('');
177
+ taxonomy_edit_box.find('.wpuxss-eml-add_new_item').val('');
178
+ taxonomy_edit_box.find('.wpuxss-eml-new_item_name').val('');
179
+ taxonomy_edit_box.find('.wpuxss-eml-parent_item').val('');
180
+ }
181
+ });
182
+
183
+ // on change of a plural taxonomy name during creation
184
+ $(document).on('blur', '.wpuxss-eml-clone-taxonomy .wpuxss-eml-name', function()
185
+ {
186
+ var taxonomy_edit_box = $(this).parents('.wpuxss-eml-taxonomy-edit');
187
+
188
+ if ( $(this).val() != '' )
189
+ {
190
+ if( taxonomy_edit_box.find('.wpuxss-eml-menu_name').val() == '' )
191
+ taxonomy_edit_box.find('.wpuxss-eml-menu_name').val($(this).val());
192
+
193
+ if( taxonomy_edit_box.find('.wpuxss-eml-all_items').val() == '' )
194
+ taxonomy_edit_box.find('.wpuxss-eml-all_items').val(wpuxss_eml_i18n_data.all+' '+$(this).val());
195
+
196
+ if( taxonomy_edit_box.find('.wpuxss-eml-search_items').val() == '' )
197
+ taxonomy_edit_box.find('.wpuxss-eml-search_items').val(wpuxss_eml_i18n_data.search+' '+$(this).val());
198
+
199
+ $(this).closest('.wpuxss-eml-clone-taxonomy').find('.wpuxss-eml-taxonomy-label').text($(this).val());
200
+ }
201
+ else
202
+ {
203
+ taxonomy_edit_box.find('.wpuxss-eml-menu_name').val('');
204
+ taxonomy_edit_box.find('.wpuxss-eml-all_items').val('');
205
+ taxonomy_edit_box.find('.wpuxss-eml-search_items').val('');
206
+ $(this).closest('.wpuxss-eml-clone-taxonomy').find('.wpuxss-eml-taxonomy-label').text(wpuxss_eml_i18n_data.tax_new);
207
+ }
208
+ });
209
+
210
+ // on taxonomy form submit
211
+ $('#wpuxss-eml-form-taxonomies').submit(function( event )
212
+ {
213
+ submit_it = true;
214
+ alert_text = '';
215
+
216
+ $('.wpuxss-eml-clone-taxonomy, .wpuxss-eml-taxonomy').each(function( index )
217
+ {
218
+ current_taxonomy = $(this).attr('id');
219
+
220
+ if ( !$('.wpuxss-eml-singular_name',this).val() && !$('.wpuxss-eml-name',this).val() )
221
+ {
222
+ submit_it = false;
223
+ alert_text = wpuxss_eml_i18n_data.tax_error_empty_both;
224
+ }
225
+ else if ( !$('.wpuxss-eml-singular_name',this).val() )
226
+ {
227
+ submit_it = false;
228
+ alert_text = wpuxss_eml_i18n_data.tax_error_empty_singular;
229
+ }
230
+ else if ( !$('.wpuxss-eml-name',this).val() )
231
+ {
232
+ submit_it = false;
233
+ alert_text = wpuxss_eml_i18n_data.tax_error_empty_plural;
234
+ }
235
+ else if ( $('.wpuxss-eml-clone-taxonomy[id='+current_taxonomy+'], .wpuxss-eml-taxonomy[id='+current_taxonomy+'], .wpuxss-non-eml-taxonomy[id='+current_taxonomy+']').length > 1 )
236
+ {
237
+ submit_it = false;
238
+ alert_text = wpuxss_eml_i18n_data.tax_error_duplicate;
239
+ }
240
+ });
241
+
242
+ if ( !submit_it ) alert(alert_text);
243
+
244
+ return submit_it;
245
+ });
246
+
247
+
248
+
249
+ // create new mime type
250
+ $(document).on('click', '.wpuxss-eml-button-create-mime', function()
251
+ {
252
+ $('.wpuxss-eml-mime-type-list').find('.wpuxss-eml-clone').clone().attr('class','wpuxss-eml-clone-mime').prependTo('.wpuxss-eml-mime-type-list tbody').show(300);
253
+
254
+ return false;
255
+ });
256
+
257
+ // remove mime type
258
+ $(document).on('click', 'tr .wpuxss-eml-button-remove', function()
259
+ {
260
+ $(this).closest('tr').hide( 300, function() {
261
+ $(this).remove();
262
+ });
263
+
264
+ return false;
265
+ });
266
+
267
+ // on change of an extension during creation
268
+ $(document).on('blur', '.wpuxss-eml-clone-mime .wpuxss-eml-type', function()
269
+ {
270
+ var extension = $(this).val().toLowerCase(),
271
+ mime_type_tr = $(this).closest('tr');
272
+
273
+ $(this).val(extension);
274
+
275
+ mime_type_tr.find('.wpuxss-eml-mime').attr('name','wpuxss_eml_mimes['+extension+'][mime]');
276
+ mime_type_tr.find('.wpuxss-eml-singular').attr('name','wpuxss_eml_mimes['+extension+'][singular]');
277
+ mime_type_tr.find('.wpuxss-eml-plural').attr('name','wpuxss_eml_mimes['+extension+'][plural]');
278
+ mime_type_tr.find('.wpuxss-eml-filter').attr('name','wpuxss_eml_mimes['+extension+'][filter]');
279
+ mime_type_tr.find('.wpuxss-eml-upload').attr('name','wpuxss_eml_mimes['+extension+'][upload]');
280
+ });
281
+
282
+
283
+ // on change of a mime type during creation
284
+ $(document).on('blur', '.wpuxss-eml-clone-mime .wpuxss-eml-mime', function()
285
+ {
286
+ var mime_type = $(this).val().toLowerCase(),
287
+ mime_type_tr = $(this).closest('tr');
288
+
289
+ $(this).val(mime_type);
290
+ });
291
+
292
+ // mime types restoration warning
293
+ $(document).on('click', '#wpuxss_eml_restore_mimes_backup', function()
294
+ {
295
+ if ( confirm(wpuxss_eml_i18n_data.mime_deletion_confirm) )
296
+ {
297
+ return true;
298
+ }
299
+
300
+ return false;
301
+ });
302
+
303
+ // on mime types form submit
304
+ $('#wpuxss-eml-form-mimetypes').submit(function( event )
305
+ {
306
+ submit_it = true;
307
+ alert_text = '';
308
+
309
+ $('.wpuxss-eml-clone-mime').each(function( index )
310
+ {
311
+ if ( !$('.wpuxss-eml-type',this).val() || $('.wpuxss-eml-type',this).val() == '' || !$('.wpuxss-eml-mime',this).val() || $('.wpuxss-eml-mime',this).val() == '' )
312
+ {
313
+ submit_it = false;
314
+ alert_text = wpuxss_eml_i18n_data.mime_error_empty_fields;
315
+ }
316
+ else if ( $('[id="'+$('.wpuxss-eml-type',this).val()+'"]').length > 0 || $('.wpuxss-eml-mime[value="'+$('.wpuxss-eml-mime',this).val()+'"]').length > 0 )
317
+ {
318
+ submit_it = false;
319
+ alert_text = wpuxss_eml_i18n_data.mime_error_duplicate;
320
+ }
321
+
322
+ if ( !$('.wpuxss-eml-singular',this).val() || $('.wpuxss-eml-singular',this).val() == '' || !$('.wpuxss-eml-plural',this).val() || $('.wpuxss-eml-plural',this).val() == '' )
323
+ {
324
+ $('.wpuxss-eml-singular',this).val($('.wpuxss-eml-mime',this).val());
325
+ $('.wpuxss-eml-plural',this).val($('.wpuxss-eml-mime',this).val());
326
+ }
327
+ });
328
+
329
+ if ( !submit_it && alert_text != '' ) alert(alert_text);
330
+
331
+ return submit_it;
332
+ });
333
+
334
+ })( jQuery );
languages/eml.pot ADDED
@@ -0,0 +1,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2013 Enhanced Media Library
2
+ # This file is distributed under the same license as the Enhanced Media Library package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Enhanced Media Library 1.0\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/enhanced-media-library\n"
7
+ "POT-Creation-Date: 2013-11-03 22:01:01+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+
15
+ #: core/options-pages.php:15
16
+ msgid "Enhanced Media Library Options"
17
+ msgstr ""
18
+
19
+ #: core/options-pages.php:16
20
+ msgid "Media Settings"
21
+ msgstr ""
22
+
23
+ #: core/options-pages.php:24 core/options-pages.php:25
24
+ #: core/options-pages.php:118
25
+ msgid "Taxonomies"
26
+ msgstr ""
27
+
28
+ #: core/options-pages.php:32 core/options-pages.php:33
29
+ #: core/options-pages.php:387
30
+ msgid "MIME Types"
31
+ msgstr ""
32
+
33
+ #: core/options-pages.php:66 core/options-pages.php:160
34
+ #: core/options-pages.php:174 core/options-pages.php:238
35
+ #: core/options-pages.php:311
36
+ msgid "Edit"
37
+ msgstr ""
38
+
39
+ #: core/options-pages.php:67
40
+ msgid "Close"
41
+ msgstr ""
42
+
43
+ #: core/options-pages.php:68 core/options-pages.php:175
44
+ #: core/options-pages.php:239
45
+ msgid "View"
46
+ msgstr ""
47
+
48
+ #: core/options-pages.php:69 core/options-pages.php:176
49
+ #: core/options-pages.php:240
50
+ msgid "Update"
51
+ msgstr ""
52
+
53
+ #: core/options-pages.php:70 core/options-pages.php:177
54
+ #: core/options-pages.php:241
55
+ msgid "Add New"
56
+ msgstr ""
57
+
58
+ #: core/options-pages.php:71 core/options-pages.php:178
59
+ #: core/options-pages.php:242
60
+ msgid "New"
61
+ msgstr ""
62
+
63
+ #: core/options-pages.php:72
64
+ msgid "Name"
65
+ msgstr ""
66
+
67
+ #: core/options-pages.php:73 core/options-pages.php:179
68
+ #: core/options-pages.php:243
69
+ msgid "Parent"
70
+ msgstr ""
71
+
72
+ #: core/options-pages.php:74 core/options-pages.php:173
73
+ #: core/options-pages.php:237
74
+ msgid "All"
75
+ msgstr ""
76
+
77
+ #: core/options-pages.php:75 core/options-pages.php:180
78
+ #: core/options-pages.php:244
79
+ msgid "Search"
80
+ msgstr ""
81
+
82
+ #: core/options-pages.php:77
83
+ msgid ""
84
+ "Taxonomy will be deleted permanently! Your media files will remain intacted, "
85
+ "but all the connections with this taxonomy and its terms will be lost."
86
+ msgstr ""
87
+
88
+ #: core/options-pages.php:78
89
+ msgid "There is already a taxonomy with the same name. Please chose other one."
90
+ msgstr ""
91
+
92
+ #: core/options-pages.php:79 core/options-pages.php:225
93
+ msgid "New Taxonomy"
94
+ msgstr ""
95
+
96
+ #: core/options-pages.php:80
97
+ msgid "Please choose Singular and Plural names for all your new taxomonies."
98
+ msgstr ""
99
+
100
+ #: core/options-pages.php:81
101
+ msgid "Please choose Singilar name for all your new taxomonies."
102
+ msgstr ""
103
+
104
+ #: core/options-pages.php:82
105
+ msgid "Please choose Plural Name for all your new taxomonies."
106
+ msgstr ""
107
+
108
+ #: core/options-pages.php:84
109
+ msgid "Warning! All your custom MIME Types will be deleted by this operation."
110
+ msgstr ""
111
+
112
+ #: core/options-pages.php:85
113
+ msgid "Please fill into all fields."
114
+ msgstr ""
115
+
116
+ #: core/options-pages.php:86
117
+ msgid "Duplicate extensions or MIME types. Please chose other one."
118
+ msgstr ""
119
+
120
+ #: core/options-pages.php:110 core/options-pages.php:378
121
+ msgid "You do not have sufficient permissions to access this page."
122
+ msgstr ""
123
+
124
+ #: core/options-pages.php:134
125
+ msgid "Media Taxonomies"
126
+ msgstr ""
127
+
128
+ #: core/options-pages.php:138 core/options-pages.php:287
129
+ msgid "Assign following taxonomies to Media Library:"
130
+ msgstr ""
131
+
132
+ #: core/options-pages.php:160 core/options-pages.php:311
133
+ msgid "Edit Taxonomy"
134
+ msgstr ""
135
+
136
+ #: core/options-pages.php:163 core/options-pages.php:227
137
+ msgid "Delete Taxonomy"
138
+ msgstr ""
139
+
140
+ #: core/options-pages.php:168 core/options-pages.php:232
141
+ msgid "Labels"
142
+ msgstr ""
143
+
144
+ #: core/options-pages.php:170 core/options-pages.php:234
145
+ msgid "Singular"
146
+ msgstr ""
147
+
148
+ #: core/options-pages.php:171 core/options-pages.php:235
149
+ msgid "Plural"
150
+ msgstr ""
151
+
152
+ #: core/options-pages.php:172 core/options-pages.php:236
153
+ msgid "Menu Name"
154
+ msgstr ""
155
+
156
+ #: core/options-pages.php:185 core/options-pages.php:204
157
+ #: core/options-pages.php:249 core/options-pages.php:314
158
+ msgid "Settings"
159
+ msgstr ""
160
+
161
+ #: core/options-pages.php:187 core/options-pages.php:251
162
+ msgid "Hierarchical"
163
+ msgstr ""
164
+
165
+ #: core/options-pages.php:188 core/options-pages.php:252
166
+ msgid "Column in Media Library"
167
+ msgstr ""
168
+
169
+ #: core/options-pages.php:189 core/options-pages.php:206
170
+ #: core/options-pages.php:253 core/options-pages.php:316
171
+ msgid "Filter in Media Library"
172
+ msgstr ""
173
+
174
+ #: core/options-pages.php:190 core/options-pages.php:207
175
+ #: core/options-pages.php:254 core/options-pages.php:317
176
+ msgid "Filter in Media Uploader"
177
+ msgstr ""
178
+
179
+ #: core/options-pages.php:191 core/options-pages.php:255
180
+ msgid "Show in Nav Menu"
181
+ msgstr ""
182
+
183
+ #: core/options-pages.php:192 core/options-pages.php:256
184
+ msgid "Remember terms order (sort)"
185
+ msgstr ""
186
+
187
+ #: core/options-pages.php:193 core/options-pages.php:257
188
+ msgid "Slug"
189
+ msgstr ""
190
+
191
+ #: core/options-pages.php:270
192
+ msgid "Add New Taxonomy"
193
+ msgstr ""
194
+
195
+ #: core/options-pages.php:283
196
+ msgid "Non-Media Taxonomies"
197
+ msgstr ""
198
+
199
+ #: core/options-pages.php:388
200
+ msgid "Add New MIME Type"
201
+ msgstr ""
202
+
203
+ #: core/options-pages.php:406 core/options-pages.php:463
204
+ msgid "Extension"
205
+ msgstr ""
206
+
207
+ #: core/options-pages.php:407 core/options-pages.php:464
208
+ msgid "MIME Type"
209
+ msgstr ""
210
+
211
+ #: core/options-pages.php:408 core/options-pages.php:465
212
+ msgid "Singular Label"
213
+ msgstr ""
214
+
215
+ #: core/options-pages.php:409 core/options-pages.php:466
216
+ msgid "Plural Label"
217
+ msgstr ""
218
+
219
+ #: core/options-pages.php:410 core/options-pages.php:467
220
+ msgid "Add Filter"
221
+ msgstr ""
222
+
223
+ #: core/options-pages.php:411 core/options-pages.php:468
224
+ msgid "Allow Upload"
225
+ msgstr ""
226
+
227
+ #: core/options-pages.php:457
228
+ msgid "Delete MIME Type"
229
+ msgstr ""
230
+
231
+ #: core/options-pages.php:474
232
+ msgid "Restore default MIME Types"
233
+ msgstr ""
234
+
235
+ #. Plugin Name
236
+ msgid "Enhanced Media Library"
237
+ msgstr ""
238
+
239
+ #. Description of the plugin
240
+ msgid "Better management for WordPress Media Library."
241
+ msgstr ""
readme.txt ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Enhanced Media Library ===
2
+ Contributors: webbistro
3
+ Tags: media library, taxonomy, taxonomies, mime, mime type, attachment, media category, media categories, media tag, media tags, media taxonomy, media taxonomies, media filter, media organizer, file types, media types, media uploader, custom, media management, attachment management, files management, ux, user experience, wp-admin, admin
4
+ Requires at least: 3.5
5
+ Tested up to: 3.7.1
6
+ Stable tag: 1.0
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+
11
+
12
+ Better management for WordPress Media Library
13
+
14
+
15
+
16
+ == Description ==
17
+
18
+ This plugin will be handy for those who need to manage a lot of media files.
19
+
20
+ = Taxonomies =
21
+
22
+ * create unlimited amount of media taxonomies (like categories and tags),
23
+ * be in total control of your custom taxonomies' parameters via admin,
24
+ * edit and delete your custom media taxonomies,
25
+ * assign existed taxonomies to the Media Library (for example, you can use post categories as a taxonomy for your media files),
26
+ * unassign any media taxonomy from the Media Library via admin,
27
+ * immediately set taxonomy term to any media file during upload via Media Uploader,
28
+ * filter media files in Media Library by your custom taxonomies, and choose which taxonomies you are willing to use for that filter,
29
+ * filter media files in Media Uploader by your custom taxonomies, and choose which taxonomies you are willing to use for that filter,
30
+ * have you attachment post type's archive page (front-end) working by default,
31
+
32
+ = MIME Types =
33
+
34
+ * create new MIME types (media file types),
35
+ * delete any MIME type,
36
+ * allow/disallow uploading for any MIME type,
37
+ * filter media files by MIME types in Media Library / Media Uploader (for example, PDFs, Documents, V-Cards, etc)
38
+ * be in total control of the names of your MIME type filters
39
+
40
+ = Coming =
41
+
42
+ New features and improvements coming...
43
+
44
+
45
+
46
+ == Installation ==
47
+
48
+ 1. Upload plugin folder to the '/wp-content/plugins/' directory
49
+
50
+ 2. Activate the plugin through the 'Plugins' menu in the WordPress admin
51
+
52
+ 3. Adjust plugin's settings on **Media Settings -> Taxonomies** or **Media Settings -> MIME Types**
53
+
54
+ 4. Enjoy Enhanced Media Library!
55
+
56
+
57
+
58
+ == Screenshots ==
59
+
60
+ Coming...
61
+
62
+
63
+
64
+ == Changelog ==
65
+
66
+ = 1.0 =
67
+
68
+ * New: Enhanced Media Library initial release.