Enhanced Media Library - Version 1.0.3

Version Description

  • Update: Better term sorting in Media Uploader
  • Update: Minor code improvements
  • Fixed: The bug with sorting of post categories and tags assigned to Media Library
Download this release

Release Info

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

Code changes from version 1.0.2 to 1.0.3

core/taxonomies.php CHANGED
@@ -196,19 +196,27 @@ function wpuxss_eml_restrict_manage_posts()
196
  {
197
  if ( $wpuxss_eml_taxonomies[$taxonomy->name]['admin_filter'] )
198
  {
199
- if ( isset($wp_query->query[$taxonomy->name]) )
 
 
 
 
 
 
 
 
 
 
200
  {
201
  $selected = $wp_query->query[$taxonomy->name];
202
  }
203
  elseif ( isset($wp_query->query['taxonomy']) && isset($wp_query->query['term']) )
204
  {
205
  $term = get_term_by( 'slug', $wp_query->query['term'], $taxonomy->name );
206
- $selected = $term->term_id;
207
- }
208
- else
209
- {
210
- $selected = 0;
211
- }
212
 
213
  wp_dropdown_categories(
214
  array(
@@ -250,10 +258,19 @@ function wpuxss_eml_parse_query($query)
250
 
251
  foreach ( get_object_taxonomies('attachment','object') as $taxonomy )
252
  {
253
- if ( isset($qv[$taxonomy->name]) && is_numeric($qv[$taxonomy->name]) )
254
  {
255
- $term = get_term_by('id', $qv[$taxonomy->name], $taxonomy->name);
256
- if ($term) $qv[$taxonomy->name] = $term->slug;
 
 
 
 
 
 
 
 
 
257
  }
258
  }
259
  }
196
  {
197
  if ( $wpuxss_eml_taxonomies[$taxonomy->name]['admin_filter'] )
198
  {
199
+ $selected = 0;
200
+
201
+ foreach ( $wp_query->tax_query->queries as $taxonomy_var )
202
+ {
203
+ if ( $taxonomy_var['taxonomy'] == $taxonomy->name && $taxonomy_var['field'] == 'term_id' )
204
+ {
205
+ $selected = $taxonomy_var['terms'][0];
206
+ }
207
+ }
208
+
209
+ if ( ! $selected && isset($wp_query->query[$taxonomy->name]) )
210
  {
211
  $selected = $wp_query->query[$taxonomy->name];
212
  }
213
  elseif ( isset($wp_query->query['taxonomy']) && isset($wp_query->query['term']) )
214
  {
215
  $term = get_term_by( 'slug', $wp_query->query['term'], $taxonomy->name );
216
+
217
+ if ( ! empty($term) )
218
+ $selected = $term->term_id;
219
+ }
 
 
220
 
221
  wp_dropdown_categories(
222
  array(
258
 
259
  foreach ( get_object_taxonomies('attachment','object') as $taxonomy )
260
  {
261
+ if ( isset($_REQUEST[$taxonomy->name]) && $_REQUEST[$taxonomy->name] )
262
  {
263
+ switch ($taxonomy->name) {
264
+ case 'category':
265
+ $qv['category__in'] = array($_REQUEST[$taxonomy->name]);
266
+ break;
267
+ case 'post_tag':
268
+ $qv['tag__in'] = array($_REQUEST[$taxonomy->name]);
269
+ break;
270
+ default:
271
+ $term = get_term_by('id', $_REQUEST[$taxonomy->name], $taxonomy->name);
272
+ if ($term) $qv[$taxonomy->name] = $term->slug;
273
+ }
274
  }
275
  }
276
  }
enhanced-media-library.php CHANGED
@@ -2,8 +2,8 @@
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.2
7
  Author: WordPress UX Solutions
8
  Author URI: http://wordpressuxsolutions.com
9
  License: GPLv2 or later
@@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31
 
32
 
33
 
34
- $wpuxss_eml_version = '1.0.2';
35
  $wpuxss_eml_old_version = get_option('wpuxss_eml_version', false);
36
  $wpuxss_eml_dir = plugin_dir_url( __FILE__ );
37
 
@@ -217,6 +217,7 @@ function wpuxss_eml_on_admin_init()
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
 
2
  /*
3
  Plugin Name: Enhanced Media Library
4
  Plugin URI: http://wordpressuxsolutions.com
5
+ Description: This plugin will be handy for those who need to manage a lot of media files.
6
+ Version: 1.0.3
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.3';
35
  $wpuxss_eml_old_version = get_option('wpuxss_eml_version', false);
36
  $wpuxss_eml_dir = plugin_dir_url( __FILE__ );
37
 
217
 
218
  wp_terms_checklist( 0, array( 'taxonomy' => $taxonomy->name, 'checked_ontop' => false, 'walker' => new Walker_Media_Taxonomy_Uploader_Filter() ) );
219
 
220
+ $html = '';
221
  if ( ob_get_contents() != false )
222
  $html = ob_get_contents();
223
 
js/eml-media-uploader.js CHANGED
@@ -14,17 +14,19 @@
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;
14
  var that = this;
15
 
16
  _.each( that.options.termList || {}, function( term, key ) {
17
+ var term_id = term['term_id'];
18
  var term_name = $("<div/>").html(term['term_name']).text();
19
+ filters[ term_id ] = {
20
  text: term_name,
21
+ priority: key+2
22
  };
23
+ filters[term_id]['props'] = {};
24
+ filters[term_id]['props'][that.options.taxonomy] = term_id;
25
  });
26
 
27
  filters.all = {
28
  text: that.options.termListTitle,
29
+ priority: 1
30
  };
31
  filters['all']['props'] = {};
32
  filters['all']['props'][that.options.taxonomy] = 0;
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.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -79,6 +79,12 @@ New features and improvements coming...
79
 
80
  == Changelog ==
81
 
 
 
 
 
 
 
82
  = 1.0.2 =
83
 
84
  * Fix: Assigned non-media taxonomies archive page fixed: [Support Request](http://wordpress.org/support/topic/plugin-woocommerce-products-stopped-displaying)
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.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
79
 
80
  == Changelog ==
81
 
82
+ = 1.0.3 =
83
+
84
+ * Update: Better term sorting in Media Uploader
85
+ * Update: Minor code improvements
86
+ * Fixed: The bug with sorting of post categories and tags assigned to Media Library
87
+
88
  = 1.0.2 =
89
 
90
  * Fix: Assigned non-media taxonomies archive page fixed: [Support Request](http://wordpress.org/support/topic/plugin-woocommerce-products-stopped-displaying)