Version Description
- Fix: Media Uploader filter now shows nested terms.
- Fix: Media Uploader filter now works correctly with multiple taxonomies.
Download this release
Release Info
Developer | webbistro |
Plugin | Enhanced Media Library |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.0.1
- core/options-pages.php +6 -5
- core/taxonomies.php +70 -20
- enhanced-media-library.php +24 -18
- js/eml-media-uploader.js +35 -54
- js/eml-options.js +15 -4
- readme.txt +27 -6
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
- screenshot-6.png +0 -0
- screenshot-7.png +0 -0
- screenshot-8.png +0 -0
- screenshot-9.png +0 -0
core/options-pages.php
CHANGED
@@ -52,11 +52,12 @@ function wpuxss_eml_admin_menu()
|
|
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 |
-
|
60 |
array('jquery'),
|
61 |
$wpuxss_eml_version,
|
62 |
true
|
@@ -154,7 +155,7 @@ function wpuxss_eml_print_taxonomies_options()
|
|
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') . ' ↓</a>';
|
@@ -220,7 +221,7 @@ function wpuxss_eml_print_taxonomies_options()
|
|
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 |
|
@@ -301,7 +302,7 @@ function wpuxss_eml_print_taxonomies_options()
|
|
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'] . '" />';
|
52 |
|
53 |
function wpuxss_eml_admin_settings_pages_scripts()
|
54 |
{
|
55 |
+
global $wpuxss_eml_version,
|
56 |
+
$wpuxss_plugin_dir;
|
57 |
|
58 |
wp_enqueue_script(
|
59 |
'wpuxss-eml-options-script',
|
60 |
+
$wpuxss_plugin_dir . '/js/eml-options.js',
|
61 |
array('jquery'),
|
62 |
$wpuxss_eml_version,
|
63 |
true
|
155 |
|
156 |
$html .= '<li class="' . $li_class . '" id="' . $taxonomy->name . '">';
|
157 |
|
158 |
+
$html .= '<input class="wpuxss-eml-assigned" name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][assigned]" type="checkbox" value="1" ' . checked( true, $assigned, false ) . ' title="Assign Taxonomy" />';
|
159 |
$html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][eml_media]" type="hidden" value="' . $eml_media . '" />';
|
160 |
$html .= ' <label>' . $taxonomy->label . '</label>';
|
161 |
$html .= '<a class="wpuxss-eml-button-edit" title="' . __('Edit Taxonomy','eml') . '" href="javascript:;">' . __('Edit','eml') . ' ↓</a>';
|
221 |
}
|
222 |
|
223 |
$html .= '<li class="wpuxss-eml-clone" style="display:none">';
|
224 |
+
$html .= '<input class="wpuxss-eml-assigned" name="" type="checkbox" class="wpuxss-eml-assigned" value="1" checked="checked" title="Assign Taxonomy" />';
|
225 |
$html .= '<input name="" type="hidden" class="wpuxss-eml-eml_media" value="1" />';
|
226 |
$html .= ' <label class="wpuxss-eml-taxonomy-label">' . __('New Taxonomy','eml') . '</label>';
|
227 |
|
302 |
if ( $taxonomy->name != 'post_format' )
|
303 |
{
|
304 |
$html .= '<li>';
|
305 |
+
$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 ) . ' title="Assign Taxonomy" />';
|
306 |
$html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][eml_media]" type="hidden" value="' . $wpuxss_eml_taxonomies[$taxonomy->name]['eml_media'] . '" />';
|
307 |
$html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][show_admin_column]" type="hidden" value="' . $wpuxss_eml_taxonomies[$taxonomy->name]['show_admin_column'] . '" />';
|
308 |
$html .= '<input name="wpuxss_eml_taxonomies[' . $taxonomy->name . '][show_in_nav_menus]" type="hidden" value="' . $wpuxss_eml_taxonomies[$taxonomy->name]['show_in_nav_menus'] . '" />';
|
core/taxonomies.php
CHANGED
@@ -133,33 +133,34 @@ function wpuxss_eml_ajax_query_attachments()
|
|
133 |
if ( ! current_user_can( 'upload_files' ) )
|
134 |
wp_send_json_error();
|
135 |
|
136 |
-
$
|
137 |
-
$
|
138 |
-
|
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 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
|
|
|
|
160 |
}
|
161 |
-
unset ( $query['taxonomy'] );
|
162 |
-
unset ( $query['term_id'] );
|
163 |
|
164 |
$query = new WP_Query( $query );
|
165 |
|
@@ -375,6 +376,55 @@ class Walker_Media_Taxonomy_Checklist extends Walker
|
|
375 |
|
376 |
|
377 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
/**
|
379 |
* wpuxss_eml_pre_get_posts
|
380 |
*
|
133 |
if ( ! current_user_can( 'upload_files' ) )
|
134 |
wp_send_json_error();
|
135 |
|
136 |
+
$taxonomies = get_object_taxonomies('attachment','names');
|
137 |
+
$valid = array('s', 'order', 'orderby', 'posts_per_page', 'paged', 'post_mime_type','post_parent', 'post__in', 'post__not_in');
|
138 |
+
$valid = array_merge($valid,$taxonomies);
|
|
|
|
|
139 |
|
140 |
+
$query = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array();
|
141 |
+
$query = array_intersect_key( $query, array_flip( $valid ) );
|
142 |
|
143 |
$query['post_type'] = 'attachment';
|
144 |
$query['post_status'] = 'inherit';
|
145 |
+
|
146 |
if ( current_user_can( get_post_type_object( 'attachment' )->cap->read_private_posts ) )
|
147 |
$query['post_status'] .= ',private';
|
148 |
+
|
149 |
+
$query['tax_query'] = array( 'relation' => 'AND' );
|
150 |
+
|
151 |
+
foreach ( $taxonomies as $taxonomy )
|
152 |
+
{
|
153 |
+
if ( isset($query[$taxonomy]) && is_numeric($query[$taxonomy]) && $query[$taxonomy] != 0 )
|
154 |
+
{
|
155 |
+
array_push($query['tax_query'],array(
|
156 |
+
'taxonomy' => $taxonomy,
|
157 |
+
'field' => 'id',
|
158 |
+
'terms' => $query[$taxonomy]
|
159 |
+
));
|
160 |
+
|
161 |
+
unset ( $query[$taxonomy] );
|
162 |
+
}
|
163 |
}
|
|
|
|
|
164 |
|
165 |
$query = new WP_Query( $query );
|
166 |
|
376 |
|
377 |
|
378 |
|
379 |
+
/**
|
380 |
+
* Walker_Media_Taxonomy_Uploader_Filter
|
381 |
+
*
|
382 |
+
* Based on /wp-includes/category-template.php
|
383 |
+
*
|
384 |
+
* @since 1.0.1
|
385 |
+
* @created 05/11/13
|
386 |
+
*/
|
387 |
+
|
388 |
+
class Walker_Media_Taxonomy_Uploader_Filter extends Walker
|
389 |
+
{
|
390 |
+
var $tree_type = 'category';
|
391 |
+
var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
|
392 |
+
|
393 |
+
function start_lvl( &$output, $depth = 0, $args = array() )
|
394 |
+
{
|
395 |
+
$output .= "";
|
396 |
+
}
|
397 |
+
|
398 |
+
function end_lvl( &$output, $depth = 0, $args = array() )
|
399 |
+
{
|
400 |
+
$output .= "";
|
401 |
+
}
|
402 |
+
|
403 |
+
function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 )
|
404 |
+
{
|
405 |
+
extract($args);
|
406 |
+
|
407 |
+
if ( empty($taxonomy) )
|
408 |
+
$taxonomy = 'category';
|
409 |
+
|
410 |
+
if ( $taxonomy == 'category' )
|
411 |
+
$name = 'post_category';
|
412 |
+
else
|
413 |
+
$name = 'tax_input['.$taxonomy.']';
|
414 |
+
|
415 |
+
$indent = str_repeat(' ', $depth);
|
416 |
+
$output .= $category->term_id . '>' . $indent . esc_html( apply_filters('the_category', $category->name )) . '|';
|
417 |
+
}
|
418 |
+
|
419 |
+
function end_el( &$output, $category, $depth = 0, $args = array() )
|
420 |
+
{
|
421 |
+
$output .= "";
|
422 |
+
}
|
423 |
+
}
|
424 |
+
|
425 |
+
|
426 |
+
|
427 |
+
|
428 |
/**
|
429 |
* wpuxss_eml_pre_get_posts
|
430 |
*
|
enhanced-media-library.php
CHANGED
@@ -3,7 +3,7 @@
|
|
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
|
@@ -31,8 +31,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
31 |
|
32 |
|
33 |
|
34 |
-
$wpuxss_eml_version = '1.0';
|
35 |
$wpuxss_eml_old_version = get_option('wpuxss_eml_version', false);
|
|
|
36 |
|
37 |
|
38 |
|
@@ -80,7 +81,7 @@ function wpuxss_eml_on_init()
|
|
80 |
// register eml taxonomies
|
81 |
foreach ( $wpuxss_eml_taxonomies as $taxonomy => $params )
|
82 |
{
|
83 |
-
if ( $params['eml_media']
|
84 |
{
|
85 |
register_taxonomy(
|
86 |
$taxonomy,
|
@@ -178,12 +179,13 @@ 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 |
-
|
187 |
array('backbone'),
|
188 |
$wpuxss_eml_version,
|
189 |
true
|
@@ -192,7 +194,7 @@ function wpuxss_eml_on_admin_init()
|
|
192 |
// admin styles
|
193 |
wp_enqueue_style(
|
194 |
'wpuxss-eml-admin-custom-style',
|
195 |
-
|
196 |
array(),
|
197 |
$wpuxss_eml_version,
|
198 |
'all'
|
@@ -206,25 +208,29 @@ function wpuxss_eml_on_admin_init()
|
|
206 |
$taxonomies_array = array();
|
207 |
foreach ( get_object_taxonomies('attachment','object') as $taxonomy )
|
208 |
{
|
209 |
-
|
|
|
|
|
|
|
210 |
{
|
211 |
-
|
212 |
-
|
213 |
-
'
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
|
|
|
|
219 |
|
220 |
if ( !empty($terms) )
|
221 |
{
|
222 |
-
$terms_array = array();
|
223 |
foreach ($terms as $term)
|
224 |
{
|
225 |
-
$
|
|
|
226 |
}
|
227 |
-
|
228 |
$taxonomies_array[$taxonomy->name] = array(
|
229 |
'list_title' => $taxonomy->labels->all_items,
|
230 |
'term_list' => $terms_array
|
3 |
Plugin Name: Enhanced Media Library
|
4 |
Plugin URI: http://wordpressuxsolutions.com
|
5 |
Description: Better management for WordPress Media Library.
|
6 |
+
Version: 1.0.1
|
7 |
Author: WordPress UX Solutions
|
8 |
Author URI: http://wordpressuxsolutions.com
|
9 |
License: GPLv2 or later
|
31 |
|
32 |
|
33 |
|
34 |
+
$wpuxss_eml_version = '1.0.1';
|
35 |
$wpuxss_eml_old_version = get_option('wpuxss_eml_version', false);
|
36 |
+
$wpuxss_plugin_dir = plugin_dir_url( __FILE__ );
|
37 |
|
38 |
|
39 |
|
81 |
// register eml taxonomies
|
82 |
foreach ( $wpuxss_eml_taxonomies as $taxonomy => $params )
|
83 |
{
|
84 |
+
if ( $params['eml_media'] && !empty($params['labels']['singular_name']) && !empty($params['labels']['name']) )
|
85 |
{
|
86 |
register_taxonomy(
|
87 |
$taxonomy,
|
179 |
|
180 |
function wpuxss_eml_on_admin_init()
|
181 |
{
|
182 |
+
global $wpuxss_eml_version,
|
183 |
+
$wpuxss_plugin_dir;
|
184 |
|
185 |
// plugin scripts
|
186 |
wp_enqueue_script(
|
187 |
'wpuxss-eml-media-uploader-script',
|
188 |
+
$wpuxss_plugin_dir . '/js/eml-media-uploader.js',
|
189 |
array('backbone'),
|
190 |
$wpuxss_eml_version,
|
191 |
true
|
194 |
// admin styles
|
195 |
wp_enqueue_style(
|
196 |
'wpuxss-eml-admin-custom-style',
|
197 |
+
$wpuxss_plugin_dir . '/css/eml-admin.css',
|
198 |
array(),
|
199 |
$wpuxss_eml_version,
|
200 |
'all'
|
208 |
$taxonomies_array = array();
|
209 |
foreach ( get_object_taxonomies('attachment','object') as $taxonomy )
|
210 |
{
|
211 |
+
$terms_array = array();
|
212 |
+
$terms = array();
|
213 |
+
|
214 |
+
if ( $wpuxss_eml_taxonomies[$taxonomy->name]['media_uploader_filter'] )
|
215 |
{
|
216 |
+
ob_start();
|
217 |
+
|
218 |
+
wp_terms_checklist( 0, array( 'taxonomy' => $taxonomy->name, 'checked_ontop' => false, 'walker' => new Walker_Media_Taxonomy_Uploader_Filter() ) );
|
219 |
+
|
220 |
+
if ( ob_get_contents() != false )
|
221 |
+
$html = ob_get_contents();
|
222 |
+
|
223 |
+
ob_end_clean();
|
224 |
+
|
225 |
+
$terms = array_filter( explode('|', $html) );
|
226 |
|
227 |
if ( !empty($terms) )
|
228 |
{
|
|
|
229 |
foreach ($terms as $term)
|
230 |
{
|
231 |
+
$term = explode('>', $term);
|
232 |
+
array_push($terms_array, array('term_id' => $term[0], 'term_name' => $term[1]));
|
233 |
}
|
|
|
234 |
$taxonomies_array[$taxonomy->name] = array(
|
235 |
'list_title' => $taxonomy->labels->all_items,
|
236 |
'term_list' => $terms_array
|
js/eml-media-uploader.js
CHANGED
@@ -5,58 +5,32 @@
|
|
5 |
var media = wp.media,
|
6 |
l10n = media.view.l10n;
|
7 |
|
8 |
-
|
9 |
-
{
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
var
|
18 |
-
|
19 |
-
|
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 |
-
|
40 |
-
}
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
if ( equal )
|
53 |
-
return value = id;
|
54 |
-
});
|
55 |
-
|
56 |
-
this.$el.val( value );
|
57 |
-
}
|
58 |
-
});
|
59 |
-
|
60 |
});
|
61 |
|
62 |
// Enhanced AttachmentBrowser
|
@@ -85,15 +59,22 @@
|
|
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
|
93 |
controller: that.controller,
|
94 |
-
model:
|
95 |
-
priority:
|
|
|
|
|
|
|
|
|
96 |
}).render() );
|
|
|
|
|
97 |
}
|
98 |
});
|
99 |
|
5 |
var media = wp.media,
|
6 |
l10n = media.view.l10n;
|
7 |
|
8 |
+
// Taxonomy AttachmentFilters
|
9 |
+
media.view.AttachmentFilters.Taxonomy = media.view.AttachmentFilters.extend({
|
10 |
+
tagName: 'select',
|
11 |
+
|
12 |
+
createFilters: function() {
|
13 |
+
var filters = {};
|
14 |
+
var that = this;
|
15 |
+
|
16 |
+
_.each( that.options.termList || {}, function( term, key ) {
|
17 |
+
var term_name = $("<div/>").html(term['term_name']).text();
|
18 |
+
filters[ key ] = {
|
19 |
+
text: term_name,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
};
|
21 |
+
filters[key]['props'] = {};
|
22 |
+
filters[key]['props'][that.options.taxonomy] = term['term_id'];
|
23 |
+
});
|
24 |
|
25 |
+
filters.all = {
|
26 |
+
text: that.options.termListTitle,
|
27 |
+
priority: 10
|
28 |
+
};
|
29 |
+
filters['all']['props'] = {};
|
30 |
+
filters['all']['props'][that.options.taxonomy] = 0;
|
31 |
+
|
32 |
+
this.filters = filters;
|
33 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
});
|
35 |
|
36 |
// Enhanced AttachmentBrowser
|
59 |
}
|
60 |
|
61 |
var that = this;
|
62 |
+
i = 1;
|
63 |
$.each(wpuxss_eml_taxonomies, function(taxonomy, values)
|
64 |
{
|
65 |
if ( filters && values.term_list )
|
66 |
+
{
|
67 |
+
that.toolbar.set( taxonomy+'-filters', new media.view.AttachmentFilters.Taxonomy({
|
68 |
controller: that.controller,
|
69 |
+
model: that.collection.props,
|
70 |
+
priority: -80 + 10*i++,
|
71 |
+
taxonomy: taxonomy,
|
72 |
+
termList: values.term_list,
|
73 |
+
termListTitle: values.list_title,
|
74 |
+
className: 'attachment-'+taxonomy+'-filters'
|
75 |
}).render() );
|
76 |
+
|
77 |
+
|
78 |
}
|
79 |
});
|
80 |
|
js/eml-options.js
CHANGED
@@ -52,7 +52,9 @@
|
|
52 |
taxonomy_name = $(this).val().toLowerCase(),
|
53 |
taxonomy_edit_box = $(this).parents('.wpuxss-eml-taxonomy-edit');
|
54 |
|
55 |
-
|
|
|
|
|
56 |
{
|
57 |
// thanks to
|
58 |
// https://github.com/borodean/jquery-translit
|
@@ -110,7 +112,8 @@
|
|
110 |
'í': 'i',
|
111 |
' ' : '_',
|
112 |
'-' : '_',
|
113 |
-
'\'' : ''
|
|
|
114 |
};
|
115 |
|
116 |
$.each( dictionary, function(k, v)
|
@@ -119,6 +122,8 @@
|
|
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 )
|
@@ -171,21 +176,26 @@
|
|
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
|
|
|
|
|
|
|
187 |
|
188 |
-
if (
|
189 |
{
|
190 |
if( taxonomy_edit_box.find('.wpuxss-eml-menu_name').val() == '' )
|
191 |
taxonomy_edit_box.find('.wpuxss-eml-menu_name').val($(this).val());
|
@@ -200,6 +210,7 @@
|
|
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('');
|
52 |
taxonomy_name = $(this).val().toLowerCase(),
|
53 |
taxonomy_edit_box = $(this).parents('.wpuxss-eml-taxonomy-edit');
|
54 |
|
55 |
+
taxonomy_name = taxonomy_name.replace(/(<([^>]+)>)/g,'');
|
56 |
+
|
57 |
+
if ( taxonomy_name != '' )
|
58 |
{
|
59 |
// thanks to
|
60 |
// https://github.com/borodean/jquery-translit
|
112 |
'í': 'i',
|
113 |
' ' : '_',
|
114 |
'-' : '_',
|
115 |
+
'\'' : '',
|
116 |
+
'&' : '_'
|
117 |
};
|
118 |
|
119 |
$.each( dictionary, function(k, v)
|
122 |
taxonomy_name = taxonomy_name.replace( regex, v );
|
123 |
});
|
124 |
|
125 |
+
taxonomy_name = taxonomy_name.replace(/[^a-z0-9_\s]/g, '');
|
126 |
+
|
127 |
$(this).closest('.wpuxss-eml-clone-taxonomy').attr('id',taxonomy_name);
|
128 |
|
129 |
if ( $('.wpuxss-eml-clone-taxonomy[id='+taxonomy_name+'], .wpuxss-eml-taxonomy[id='+taxonomy_name+'], .wpuxss-non-eml-taxonomy[id='+taxonomy_name+']').length > 1 )
|
176 |
}
|
177 |
else
|
178 |
{
|
179 |
+
$(this).val('');
|
180 |
taxonomy_edit_box.find('.wpuxss-eml-edit_item').val('');
|
181 |
taxonomy_edit_box.find('.wpuxss-eml-view_item').val('');
|
182 |
taxonomy_edit_box.find('.wpuxss-eml-update_item').val('');
|
183 |
taxonomy_edit_box.find('.wpuxss-eml-add_new_item').val('');
|
184 |
taxonomy_edit_box.find('.wpuxss-eml-new_item_name').val('');
|
185 |
taxonomy_edit_box.find('.wpuxss-eml-parent_item').val('');
|
186 |
+
taxonomy_edit_box.find('.wpuxss-eml-slug').val('');
|
187 |
}
|
188 |
});
|
189 |
|
190 |
// on change of a plural taxonomy name during creation
|
191 |
$(document).on('blur', '.wpuxss-eml-clone-taxonomy .wpuxss-eml-name', function()
|
192 |
{
|
193 |
+
var taxonomy_plural_name = $(this).val();
|
194 |
+
taxonomy_edit_box = $(this).parents('.wpuxss-eml-taxonomy-edit');
|
195 |
+
|
196 |
+
taxonomy_plural_name = taxonomy_plural_name.replace(/(<([^>]+)>)/g,'');
|
197 |
|
198 |
+
if ( taxonomy_plural_name != '' )
|
199 |
{
|
200 |
if( taxonomy_edit_box.find('.wpuxss-eml-menu_name').val() == '' )
|
201 |
taxonomy_edit_box.find('.wpuxss-eml-menu_name').val($(this).val());
|
210 |
}
|
211 |
else
|
212 |
{
|
213 |
+
$(this).val('');
|
214 |
taxonomy_edit_box.find('.wpuxss-eml-menu_name').val('');
|
215 |
taxonomy_edit_box.find('.wpuxss-eml-all_items').val('');
|
216 |
taxonomy_edit_box.find('.wpuxss-eml-search_items').val('');
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ 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 |
|
@@ -22,8 +22,8 @@ This plugin will be handy for those who need to manage a lot of media files.
|
|
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
|
26 |
-
* unassign any media taxonomy from
|
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,
|
@@ -45,9 +45,9 @@ New features and improvements coming...
|
|
45 |
|
46 |
== Installation ==
|
47 |
|
48 |
-
1. Upload plugin folder to
|
49 |
|
50 |
-
2. Activate the plugin through
|
51 |
|
52 |
3. Adjust plugin's settings on **Media Settings -> Taxonomies** or **Media Settings -> MIME Types**
|
53 |
|
@@ -57,12 +57,33 @@ New features and improvements coming...
|
|
57 |
|
58 |
== Screenshots ==
|
59 |
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
|
63 |
|
64 |
== Changelog ==
|
65 |
|
|
|
|
|
|
|
|
|
|
|
66 |
= 1.0 =
|
67 |
|
68 |
* New: Enhanced Media Library initial release.
|
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.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
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 Media Library (for example, you can use post categories as a taxonomy for your media files),
|
26 |
+
* unassign any media taxonomy from 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,
|
45 |
|
46 |
== Installation ==
|
47 |
|
48 |
+
1. Upload plugin folder to '/wp-content/plugins/' directory
|
49 |
|
50 |
+
2. Activate the plugin through 'Plugins' menu in WordPress admin
|
51 |
|
52 |
3. Adjust plugin's settings on **Media Settings -> Taxonomies** or **Media Settings -> MIME Types**
|
53 |
|
57 |
|
58 |
== Screenshots ==
|
59 |
|
60 |
+
1. Enhanced Media Library Taxonomies Settings
|
61 |
+
|
62 |
+
2. Taxonomies in Nav Menu
|
63 |
+
|
64 |
+
3. Edit media taxonomies just like any others
|
65 |
+
|
66 |
+
4. Edit media taxonomies just like any others
|
67 |
+
|
68 |
+
5. Taxonomy columns and filters, sorting by MIME types in Media Library
|
69 |
+
|
70 |
+
6. MIME type filter in Media Uploader
|
71 |
+
|
72 |
+
7. Taxonomy filter in Media Uploader
|
73 |
+
|
74 |
+
8. Set taxonomy term right in Media Uploader
|
75 |
+
|
76 |
+
9. MIME type manager
|
77 |
|
78 |
|
79 |
|
80 |
== Changelog ==
|
81 |
|
82 |
+
= 1.0.1 =
|
83 |
+
|
84 |
+
* Fix: Media Uploader filter now shows nested terms.
|
85 |
+
* Fix: Media Uploader filter now works correctly with multiple taxonomies.
|
86 |
+
|
87 |
= 1.0 =
|
88 |
|
89 |
* New: Enhanced Media Library initial release.
|
screenshot-1.png
ADDED
Binary file
|
screenshot-2.png
ADDED
Binary file
|
screenshot-3.png
ADDED
Binary file
|
screenshot-4.png
ADDED
Binary file
|
screenshot-5.png
ADDED
Binary file
|
screenshot-6.png
ADDED
Binary file
|
screenshot-7.png
ADDED
Binary file
|
screenshot-8.png
ADDED
Binary file
|
screenshot-9.png
ADDED
Binary file
|